Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony] nestedSet - problem, Sf 1.4
janek9
post
Post #1





Grupa: Zarejestrowani
Postów: 121
Pomógł: 2
Dołączył: 22.03.2009

Ostrzeżenie: (0%)
-----


Witam, probuje uruchomic nestedtree zgodnie z dokumentacja dla propel 1.3. Utworzylem tabele tak jak jest tam opisane, natomiast przy probie zapisu do tej tabeli nie widzi funkcji: makeRoot(). Co jest grane..? Pomoże mi ktos..

  1.  
  2. root = new Menu();
  3. $root->setText('Google');
  4. $root->setLink('http://www.google.com');
  5.  
  6. $root->makeRoot();
  7. $root->setScopeIdValue(1); // Tree 1
  8. $root->save();
  9.  
  10. $menu = new Menu();
  11. $menu->setText('Google Mail');
  12. $menu->setLink('http://mail.google.com');
  13. $menu->insertAsLastChildOf($root);
  14. $menu->save();
  15.  
  16. // Create secund root node
  17. $root2 = new Menu();
  18. $root2->setText('Yahoo!');
  19. $root2->setLink('http://www.yahoo.com');
  20.  
  21. $root2->makeRoot();
  22. $root2->setScopeIdValue(2); // Tree 2
  23. $root2->save();
  24.  
  25. $menu = new Menu();
  26. $menu->setText('Yahoo! Mail');
  27. $menu->setLink('http://mail.yahoo.com');
  28. $menu->insertAsLastChildOf($root2);
  29. $menu->save();
  30.  



link do dokumentacji: nestedset propel1.3
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
strife
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 605
Pomógł: 96
Dołączył: 22.10.2004
Skąd: UK

Ostrzeżenie: (0%)
-----


A jak wygląda Twój model (chodzi mi o plik schema.yml) ? Spróbuj zrobić analogicznie do tego: http://www.agehrke.com/2009/04/nested-set-in-propel-13/

Jak to nie pomoże to będziemy myśleć dalej (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 9.10.2025 - 14:20