Completed
Pull Request — develop (#169)
by Robbie
07:51
created

AbstractAttributeCommand::getAttribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
rs 9.4286
cc 1
eloc 5
nc 1
nop 2
1
<?php
2
3
namespace N98\Magento\Command\Eav\Attribute;
4
5
use N98\Magento\Command\AbstractMagentoCommand;
6
use Magento\Eav\Model\Config;
7
8
abstract class AbstractAttributeCommand extends AbstractMagentoCommand
9
{
10
    /**
11
     * Gets an attribute model
12
     * 
13
     * @param  string $entityType
14
     * @param  string $attributeCode
15
     * @return Magento\Eav\Model\Entity\Attribute\AbstractAttribute
16
     */
17
    public function getAttribute($entityType, $attributeCode)
18
    {
19
        return $this
20
            ->getObjectManager()
21
            ->get(Config::class)
22
            ->getAttribute($entityType, $attributeCode);
23
    }    
24
}
25