Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Set entity to use for attributes
- *
- * @param MagentoEavModelEntityAbstractEntity $entity
- * @return $this
- * @throws LocalizedException
- */
- public function setEntity($entity)
- {
- if ($entity instanceof MagentoEavModelEntityAbstractEntity) {
- $this->_entity = $entity;
- } elseif (is_string($entity) || $entity instanceof MagentoFrameworkAppConfigElement) {
- $this->_entity = $this->_eavEntityFactory->create()->setType($entity);
- } else {
- throw new LocalizedException(__('Invalid entity supplied: %1', print_r($entity, 1)));
- }
- return $this;
- }
Add Comment
Please, Sign In to add comment