コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function getDefaultGroupId($setId = null)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getDefaultGroupId');
     if (!$pluginInfo) {
         return parent::getDefaultGroupId($setId);
     } else {
         return $this->___callPlugins('getDefaultGroupId', func_get_args(), $pluginInfo);
     }
 }
コード例 #2
0
ファイル: Relation.php プロジェクト: Doability/magento2dev
 private function getGroupId()
 {
     if (!$this->groupName) {
         return $this->attributeSetObj->getDefaultGroupId();
     }
     /* @var $collection \Magento\Catalog\Model\ResourceModel\Collection\AbstractCollection */
     $collection = $this->attributeGroupFactory->create()->getCollection();
     $collection->addFieldToFilter('attribute_group_name', $this->groupName);
     $collection->addFieldToFilter('attribute_set_id', $this->setId);
     $firstItem = $collection->getFirstItem();
     if ($firstItem && $firstItem->getId()) {
         return $firstItem->getId();
     }
     return $this->attributeSetObj->getDefaultGroupId();
 }