protected getCategory ( integer $categoryId ) : Elcodi\Component\Product\Entity\Interfaces\CategoryInterface | ||
$categoryId | integer | Category Id |
리턴 | Elcodi\Component\Product\Entity\Interfaces\CategoryInterface | Category |
protected function getCategory($categoryId)
{
$category = $this->getContainer()->get('elcodi.repository.category')->find($categoryId);
if (!$category instanceof ProductInterface) {
throw new EntityNotFoundException(sprintf('Category with id %d was not found', $categoryId));
}
return $category;
}