/** * @param string $text * @return TodoList */ public function createList($text) { $todoList = new TodoList(); $todoList->setName($text); $this->objectManager->persist($todoList); $this->objectManager->flush(); return $todoList; }