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

AttributeOption   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
eloc 11
c 1
b 0
f 0
dl 0
loc 68
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A isTableAttribute() 0 3 2
A setTypeConfig() 0 3 1
A getTypeConfig() 0 3 1
A setConstraints() 0 3 1
A getType() 0 3 1
A getConstraints() 0 3 1
A setType() 0 3 1
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