Hago lo siguiente.
ProjectClass
Código:
Donde llamo los métodos.private function loadTasks(){ $bd = $_SESSION['bd']; // load all tasks of the project $TaskClass = new TaskClass(1,2, 3, 4, 5); // Cargo de mysql a l'array de objctsTaskClass .a on parentid=0 osea el padre sin padre. $dataset = $bd->loadMainTasks($this->getProjectId()); while ($registro = mysql_fetch_array($dataset)) { $this->createMainTask(0,$registro['name'], $registro['initialdate'], $registro['enddate'], $registro['desc']); } // Cargo de mysql a l'array de objctsTaskClass .a on parentid=x osea el padre con padre/s. $dataset = $bd->loadTask($this->getProjectId()); $TaskClass = new TaskClass(1,2,3,4,5); while ($registro = mysql_fetch_array($dataset)) { if($registro['parentid'] !="0"){ $TaskClass->addChild($registro['parentid'],$registro['name'],$registro['initialdate'], $registro['enddate'], $registro['desc']); } } }
Código:
Pero me sale el siguiente error:$ProjectClass = $_SESSION["ProjectClass"]; $PoorChilds = $ProjectClass->getArrayOfTask(); echo $PoorChilds[0]->getNameProject();
Código:
Gracias de antemano Fatal error: main() [<a href='function.main'>function.main</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "TaskClass" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in E:\EasyPHP-5.3.6.0\www\Exam\pages\homepageC2.php on line 28