/** * {@inheritdoc} */ public function get($groupId) { /** @var \Magento\Catalog\Model\Product\Attribute\Group $group */ $group = $this->groupFactory->create(); $this->groupResource->load($group, $groupId); if (!$group->getId()) { throw new NoSuchEntityException(__('Group with id "%1" does not exist.', $groupId)); } return $group; }
/** * {@inheritdoc} */ public function delete(\Magento\Eav\Api\Data\AttributeGroupInterface $group) { try { $this->groupResource->delete($group); } catch (\Exception $e) { throw new StateException(__('Cannot delete attributeGroup with id %1', $group->getId()), $e); } return true; }