TagValue::setExternalId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
3
namespace Loevgaard\DandomainFoundation\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Knp\DoctrineBehaviors\Model\Translatable\Translatable;
7
use Loevgaard\DandomainFoundation\Entity\Generated\TagInterface;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...\Generated\TagInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Loevgaard\DandomainFoundation\Entity\Generated\TagValueInterface;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...rated\TagValueInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Loevgaard\DandomainFoundation\Entity\Generated\TagValueTrait;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...Generated\TagValueTrait was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use Loevgaard\DandomainFoundation\Entity\Generated\TagValueTranslationInterface;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...lueTranslationInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
12
/**
13
 * @ORM\Entity()
14
 * @ORM\Table(name="ldf_tag_values")
15
 *
16
 * @method TagValueTranslationInterface translate(string $locale = null, bool $fallbackToDefault = true)
17
 */
18
class TagValue extends AbstractEntity implements TagValueInterface
19
{
20
    use TagValueTrait;
21
    use Translatable;
22
23
    /**
24
     * @var int
25
     *
26
     * @ORM\Id
27
     * @ORM\GeneratedValue
28
     * @ORM\Column(type="integer")
29
     **/
30
    protected $id;
31
32
    /**
33
     * @var int
34
     *
35
     * @ORM\Column(type="integer", unique=true)
36
     **/
37
    protected $externalId;
38
39
    /**
40
     * @var int|null
41
     *
42
     * @ORM\Column(type="integer", nullable=true)
43
     **/
44
    protected $sortOrder;
45
46
    /**
47
     * @var TagInterface|null
48
     *
49
     * @ORM\ManyToOne(targetEntity="Tag", inversedBy="tagValues")
50
     * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
51
     */
52
    protected $tag;
53
54
    /**
55
     * @return int
56
     */
57
    public function getId(): int
58
    {
59
        return (int) $this->id;
60
    }
61
62
    /**
63
     * @param int $id
64
     *
65
     * @return TagValue
66
     */
67
    public function setId(int $id)
68
    {
69
        $this->id = $id;
70
71
        return $this;
72
    }
73
74
    /**
75
     * @return int
76
     */
77
    public function getExternalId(): int
78
    {
79
        return (int) $this->externalId;
80
    }
81
82
    /**
83
     * @param int $externalId
84
     *
85
     * @return TagValue
86
     */
87
    public function setExternalId(int $externalId)
88
    {
89
        $this->externalId = $externalId;
90
91
        return $this;
92
    }
93
94
    /**
95
     * @return int|null
96
     */
97
    public function getSortOrder(): ?int
98
    {
99
        return $this->sortOrder;
100
    }
101
102
    /**
103
     * @param int|null $sortOrder
104
     *
105
     * @return TagValue
106
     */
107
    public function setSortOrder(?int $sortOrder)
108
    {
109
        $this->sortOrder = $sortOrder;
110
111
        return $this;
112
    }
113
114
    /**
115
     * @return TagInterface
116
     */
117
    public function getTag(): TagInterface
118
    {
119
        return $this->tag;
120
    }
121
122
    /**
123
     * @param TagInterface $tag
124
     *
125
     * @return TagValueInterface
126
     */
127
    public function setTag(?TagInterface $tag)
128
    {
129
        $this->tag = $tag;
130
131
        return $this;
132
    }
133
}
134