AbstractAttributeCommand::getAttribute()   A
last analyzed

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
dl 0
loc 7
rs 9.4285
c 1
b 0
f 1
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
use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
8
9
abstract class AbstractAttributeCommand extends AbstractMagentoCommand
10
{
11
    /**
12
     * Gets an attribute model
13
     *
14
     * @param string $entityType
15
     * @param string $attributeCode
16
     * @return AbstractAttribute
17
     */
18
    public function getAttribute($entityType, $attributeCode)
19
    {
20
        return $this
21
            ->getObjectManager()
22
            ->get(Config::class)
23
            ->getAttribute($entityType, $attributeCode);
24
    }
25
}
26