public function processCategoryForm(Form $form, $values) { if ($this->category == NULL) { $this->category = $this->categories->createEntity(); } $this->category->setTitle($values->title); $this->categories->persist($this->category); $this->redirect('Category:'); }