public function edit(Request $request, $id) { $entity = parent::edit($request, $id); if ($idArticleCategory = $request->request->get('id_article_category')) { $categoryEntity = $this->categoryRepository->find($idArticleCategory); $entity->setCategory($categoryEntity); } if ($idAuthor = $request->request->get('id_author')) { $userEntity = $this->userRepository->find($idAuthor); $entity->setAuthor($userEntity); } return $entity; }
public function __construct(CategoryRepository $categoryRepository) { parent::__construct($categoryRepository); }
public function __construct(NewsRepository $newsRepository) { parent::__construct($newsRepository); }