/** * Return default static virtual attribute that doesn't exists in EAV attributes * * @param \Magento\Eav\Model\Entity\AbstractEntity $resource * @param string $attributeCode * @return Attribute */ protected function _getDefaultAttribute(AbstractEntity $resource, $attributeCode) { $entityTypeId = $resource->getEntityType()->getId(); if (!isset($this->defaultAttributes[$entityTypeId][$attributeCode])) { $attribute = $this->objectManager->create($resource->getEntityType()->getAttributeModel())->setAttributeCode($attributeCode)->setBackendType(AbstractAttribute::TYPE_STATIC)->setIsGlobal(1)->setEntityType($resource->getEntityType())->setEntityTypeId($resource->getEntityType()->getId()); $this->defaultAttributes[$entityTypeId][$attributeCode] = $attribute; } return $this->defaultAttributes[$entityTypeId][$attributeCode]; }
/** * Getter and lazy loader for _type * * @throws \Magento\Framework\Exception\LocalizedException * @return \Magento\Eav\Model\Entity\Type */ public function getEntityType() { if (empty($this->_type)) { $this->setType('customer_address'); } return parent::getEntityType(); }
public function getEntityType() { if (empty($this->_type)) { $this->setType(\Harvey\Office\Model\Employee::ENTITY); } return parent::getEntityType(); }
/** * {@inheritdoc} */ public function getEntityType() { if (empty($this->_type)) { $this->setType(\MIrasvit\Blog\Model\Post::ENTITY); } return parent::getEntityType(); }
/** * Getter and lazy loader for _type * * @throws \Magento\Framework\Exception\LocalizedException * @return \Magento\Eav\Model\Entity\Type */ public function getEntityType() { if (empty($this->_type)) { /* equals to eav_entity_type.entity_type_code */ /* which further equals to /app/code/Foggyline/Office/Setup/EmployeeSetup.php, key value under the return array of getDefaultEntities method */ $this->setType(\Foggyline\Office\Model\Employee::ENTITY); /* Here we assigned full, sor of name-spaced value for entity type */ } return parent::getEntityType(); }