/** * {@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); } }
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(); }