Esempio n. 1
0
 /**
  * @param \Generated\Shared\Transfer\CategoryTransfer $category
  * @param \Generated\Shared\Transfer\LocaleTransfer $locale
  * @param \Orm\Zed\Category\Persistence\SpyCategoryAttribute $categoryAttributeEntity
  *
  * @return void
  */
 protected function saveCategoryAttribute(CategoryTransfer $category, LocaleTransfer $locale, SpyCategoryAttribute $categoryAttributeEntity)
 {
     $categoryAttributeEntity->fromArray($category->toArray());
     $categoryAttributeEntity->setFkCategory($category->getIdCategory());
     $categoryAttributeEntity->setFkLocale($locale->getIdLocale());
     $categoryAttributeEntity->save();
 }
Esempio n. 2
0
 /**
  * @param \Generated\Shared\Transfer\CategoryTransfer $categoryTransfer
  * @param \Generated\Shared\Transfer\LocaleTransfer $locale
  * @param array $data
  *
  * @return \Generated\Shared\Transfer\NodeTransfer
  */
 protected function updateCategoryNodeChild(CategoryTransfer $categoryTransfer, LocaleTransfer $locale, array $data)
 {
     $nodeTransfer = $this->createCategoryNodeTransferFromData($data);
     $nodeTransfer->setIsMain(false);
     $existingCategoryNode = $this->getFactory()->getCategoryQueryContainer()->queryNodeByIdCategoryAndParentNode($categoryTransfer->getIdCategory(), $nodeTransfer->getFkParentCategoryNode())->findOne();
     $this->createOrUpdateCategoryNode($existingCategoryNode, $nodeTransfer, $locale);
     return $nodeTransfer;
 }