public function findTodoItemBySchemaIndex(Schema $schema, $milestoneSchemaKey, $todoListSchemaKey, $todoItemSchemaKey) { foreach ($schema->getMilestones() as $x => $schemaMilestone) { if ($x != $milestoneSchemaKey) { continue; } $milestone = $this->findMilestoneByTitle($schemaMilestone->getTitle()); if ($milestone === null) { break; } foreach ($schemaMilestone->getTodoLists() as $y => $schemaTodoList) { if ($y != $todoListSchemaKey) { continue; } $todoList = $this->findTodoListByName($schemaTodoList->getName()); if ($todoList === null) { break; } foreach ($schemaTodoList->getTodoItems() as $z => $schemaTodoItem) { if ($z != $todoItemSchemaKey) { continue; } return $todoList->findTodoItemByContent($schemaTodoItem->getContent()); } } } return null; }
public function getSchemaInstance() { $schema = new Schema(); $schema->setService($this); return $schema; }