Guest User

Untitled

a guest
May 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. /**
  2. * @var MagentoEavModelResourceModelEntityAttribute
  3. */
  4. protected $_eavAttribute;
  5. /**
  6. * @param Context $context
  7. * @param MagentoEavModelResourceModelEntityAttribute $eavAttribute
  8. */
  9. public function __construct(
  10. Context $context,
  11. MagentoEavModelResourceModelEntityAttribute $eavAttribute
  12. )
  13. {
  14. $this->_eavAttribute = $eavAttribute;
  15. parent::__construct($context);
  16. }
  17.  
  18. //Call the getIdByCode method of Attribute in any method
  19.  
  20. $attributeId = $this->_eavAttribute->getIdByCode('customer', 'company_name');
Add Comment
Please, Sign In to add comment