/** * Install fixtures for ToDoList * * @return void */ public function fixturesCommand() { $activeToDoList = new ToDoList(); for ($i = 1; $i <= 3; $i++) { $item = new Item(); $item->setLabel('Item #' . $i); $activeToDoList->addItem($item); } $this->toDoListRepository->add($activeToDoList); $this->outputLine('Successfully created fixtures'); }
/** * Add a new list item * * @param Item $item */ public function addItem(Item $item) { $item->setList($this); $this->items->add($item); }
/** * Mark a list item as undone * * @param Item $item * @throws \TYPO3\Flow\Persistence\Exception\IllegalObjectTypeException */ public function undoAction(Item $item) { $item->markAsUnDone(); $this->itemRepository->update($item); $this->view->assign('value', array('type' => 'success:undo', 'entity' => get_class($item))); }