Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [Symfony]Propel 1.3 Nested set + RecursiveIteratorIterator
Lonas
post 12.12.2008, 11:30:06
Post #1





Grupa: Zarejestrowani
Postów: 576
Pomógł: 14
Dołączył: 9.11.2005

Ostrzeżenie: (20%)
X----


Hej mam takie pytanie odnosnie nested set w propelu 1.3 czy ktos juz z tego korzystal.

Z tworzeniem drzewa nie ma problemu ale z odczytaniem troszke tak poniewaz drzewo jest domyslnie odczytywane w odwrotnej kolejnosci. Zeby dostac poprawne drzewo trzeba uzyc klasy RecursiveIteratorIterator

tutaj jest link do manuala z propela http://propel.phpdb.org/trac/wiki/Users/Do.../Tree/NestedSet

mam taki problem odczytuje drzewo i probuje wyswietlic :

  1. <?php
  2. $root = CategoryPeer::retrieveTree(1);
  3. $this->it = new RecursiveIteratorIterator($root, RecursiveIteratorIterator::SELF_FIRST);
  4. ?>


dostaje error - chyba nie do konca kumam jak nalezy uzywac tej klasy RecursiveIteratorIterator
  1. Catchable fatal error: Argument 1 passed to RecursiveIteratorIterator::__construct() must implement interface Traversable, boolean given, called in C:\Program Files\WebServ\httpd\sf_sandbox\lib\symfony\action\sfActions. class.php on line 53 and defined in C:\Program Files\WebServ\httpd\sf_sandbox\apps\frontend\modules\tree\ac tions\actions.class.php on line 44


--------------------
Go to the top of the page
+Quote Post
dafi
post 7.01.2009, 14:24:57
Post #2





Grupa: Zarejestrowani
Postów: 9
Pomógł: 1
Dołączył: 14.03.2005

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


jakbyś poczytał dokładnie komunikat o błędzie to byś zauważył " Argument 1 passed to RecursiveIteratorIterator::__construct() must implement interface Traversable"
i dalej "boolean given"
twój obiekt $root nie jest instancją klasy "CategoryPeer" która implementuje interfejs Traversable,
sprawdz sobie co zwraca ci metoda CategoryPeer::retrieveTree(1); bo w/g mnie false
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 5.07.2025 - 09:53