Passed
Push — fix-select-form-3.0 ( db8ac9...078a29 )
by Claudio
06:31 queued 23s
created

AttributeOption::isTableAttribute()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Flagbit\Bundle\TableAttributeBundle\Entity;
4
5
use Akeneo\Pim\Structure\Component\Model\AttributeOption as BaseAttributeOption;
6
use Flagbit\Bundle\TableAttributeBundle\AttributeType\TableType;
7
8
/**
9
 * @todo move Table specific columns into an own entity
10
 */
11
class AttributeOption extends BaseAttributeOption implements ConstraintConfigInterface
12
{
13
    /**
14
     * @var string
15
     */
16
    private $type;
17
18
    /**
19
     * @var array
20
     */
21
    private $constraints;
22
23
    /**
24
     * @var array
25
     */
26
    private $typeConfig;
27
28
    /**
29
     * @return string
30
     */
31
    public function getType()
32
    {
33
        return $this->type;
34
    }
35
36
    /**
37
     * @param string $type
38
     */
39
    public function setType($type)
40
    {
41
        $this->type = $type;
42
    }
43
44
    /**
45
     * @return array
46
     */
47
    public function getConstraints()
48
    {
49
        return $this->constraints;
50
    }
51
52
    /**
53
     * @param array $constraints
54
     */
55
    public function setConstraints($constraints)
56
    {
57
        $this->constraints = $constraints;
58
    }
59
60
    /**
61
     * @return array
62
     */
63
    public function getTypeConfig()
64
    {
65
        return $this->typeConfig;
66
    }
67
68
    /**
69
     * @param array $typeConfig
70
     */
71
    public function setTypeConfig($typeConfig)
72
    {
73
        $this->typeConfig = $typeConfig;
74
    }
75
76
    public function isTableAttribute() : bool
77
    {
78
        return null !== $this->attribute && TableType::FLAGBIT_CATALOG_TABLE === $this->attribute->getType();
79
    }
80
}
81