示例#1
0
 private function saveAttributeSet()
 {
     if ($this->attributeSetObj->getId()) {
         return array('result' => true, 'obj' => $this->attributeSetObj);
     }
     $this->attributeSetObj->setEntityTypeId($this->entityTypeId)->setAttributeSetName($this->setName);
     try {
         $this->attributeSetObj->validate();
         $this->attributeSetObj->save();
         $this->attributeSetObj->initFromSkeleton($this->skeletonId)->save();
     } catch (\Exception $e) {
         return array('result' => false, 'error' => $e->getMessage());
     }
     return array('result' => true, 'obj' => $this->attributeSetObj);
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function initFromSkeleton($skeletonId)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'initFromSkeleton');
     if (!$pluginInfo) {
         return parent::initFromSkeleton($skeletonId);
     } else {
         return $this->___callPlugins('initFromSkeleton', func_get_args(), $pluginInfo);
     }
 }