N98\Magento\Command\Eav\Attribute\ViewCommand::getAttribute PHP Method

getAttribute() protected method

protected getAttribute ( string $entityType, string $attributeCode ) : Mage_Eav_Model_Entity_Attribute_Abstract | false
$entityType string
$attributeCode string
return Mage_Eav_Model_Entity_Attribute_Abstract | false
    protected function getAttribute($entityType, $attributeCode)
    {
        return \Mage::getModel('eav/config')->getAttribute($entityType, $attributeCode);
    }

Usage Example

Example #1
0
 /**
  * Should return an attribute model (from the abstract class)
  * @test
  */
 public function getAttribute()
 {
     $result = $this->command->getAttribute('catalog_product', 'sku');
     $this->assertInstanceOf('Magento\\Eav\\Model\\Entity\\Attribute\\AbstractAttribute', $result);
 }