/** * @param PersonCategoryRegisterDTO $personCategoryDTO * @return PersonCategory */ public function registerDTOtoNewPersonCategory(PersonCategoryRegisterDTO $personCategoryDTO) { $personCategory = PersonCategory::registerPersonCategory($personCategoryDTO->name, $personCategoryDTO->memo); return $personCategory; }
private function createPersonCategory($name) { $category = PersonCategory::registerPersonCategory($name); $current = $this->init->personCategoryRepo->findOneBy(array('name' => $name)); if (empty($current)) { $this->init->personCategoryRepo->store($category); return $category; } return $current; }