Guest User

Untitled

a guest
Oct 22nd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. /**
  2. * Set entity to use for attributes
  3. *
  4. * @param MagentoEavModelEntityAbstractEntity $entity
  5. * @return $this
  6. * @throws LocalizedException
  7. */
  8. public function setEntity($entity)
  9. {
  10. if ($entity instanceof MagentoEavModelEntityAbstractEntity) {
  11. $this->_entity = $entity;
  12. } elseif (is_string($entity) || $entity instanceof MagentoFrameworkAppConfigElement) {
  13. $this->_entity = $this->_eavEntityFactory->create()->setType($entity);
  14. } else {
  15. throw new LocalizedException(__('Invalid entity supplied: %1', print_r($entity, 1)));
  16. }
  17. return $this;
  18. }
Add Comment
Please, Sign In to add comment