Completed
Pull Request — develop (#169)
by Robbie
18:02 queued 06:04
created

AbstractAttributeCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAttribute() 0 7 1
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