Exemplo n.º 1
0
 /**
  * @param \Generated\Shared\Transfer\CategoryTransfer $category
  * @param \Generated\Shared\Transfer\LocaleTransfer $locale
  *
  * @return int
  */
 public function create(CategoryTransfer $category, LocaleTransfer $locale)
 {
     $categoryEntity = new SpyCategory();
     $categoryEntity->fromArray($category->toArray());
     $categoryEntity->save();
     $idCategory = $categoryEntity->getPrimaryKey();
     $category->setIdCategory($idCategory);
     $this->persistCategoryAttribute($category, $locale);
     return $idCategory;
 }