Issues (174)

src/Entity/Segment.php (2 issues)

Labels
Severity
1
<?php
2
3
namespace Loevgaard\DandomainFoundation\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\ORM\Mapping as ORM;
7
use Loevgaard\DandomainFoundation\Entity\Generated\SegmentInterface;
0 ignored issues
show
The type Loevgaard\DandomainFound...erated\SegmentInterface 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\SegmentTrait;
0 ignored issues
show
The type Loevgaard\DandomainFound...\Generated\SegmentTrait 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
10
/**
11
 * @ORM\Entity()
12
 * @ORM\Table(name="ldf_segments")
13
 */
14
class Segment extends AbstractEntity implements SegmentInterface
15
{
16
    use SegmentTrait;
17
18
    protected $hydrateConversions = [
19
        'id' => 'externalId',
20
    ];
21
22
    /**
23
     * @var int
24
     *
25
     * @ORM\Id
26
     * @ORM\GeneratedValue
27
     * @ORM\Column(type="integer")
28
     **/
29
    protected $id;
30
31
    /**
32
     * @var string
33
     *
34
     * @ORM\Column(type="string", unique=true, length=191)
35
     */
36
    protected $externalId;
37
38
    /**
39
     * @var Category[]|ArrayCollection
40
     *
41
     * @ORM\ManyToMany(mappedBy="segments", targetEntity="Category")
42
     */
43
    protected $categories;
44
45
    /**
46
     * @var Product[]|ArrayCollection
47
     *
48
     * @ORM\ManyToMany(mappedBy="segments", targetEntity="Product")
49
     */
50
    protected $products;
51
52
    /**
53
     * @var array|null
54
     *
55
     * @ORM\Column(nullable=true, type="json")
56
     */
57
    protected $segmentOptions;
58
59 4
    /**
60
     * @return int
61 4
     */
62 2
    public function getId(): int
63
    {
64 2
        return (int) $this->id;
65
    }
66
67 2
    /**
68
     * @param int $id
69 2
     *
70
     * @return SegmentInterface
71 2
     */
72 1
    public function setId(int $id)
73
    {
74 5
        $this->id = $id;
75
76 5
        return $this;
77
    }
78
79
    /**
80
     * @return string
81
     */
82 4
    public function getExternalId(): string
83
    {
84 4
        return (string) $this->externalId;
85
    }
86 2
87
    /**
88
     * @param string $externalId
89
     *
90
     * @return SegmentInterface
91
     */
92 3
    public function setExternalId(string $externalId)
93
    {
94 3
        $this->externalId = $externalId;
95
96 1
        return $this;
97
    }
98
99
    /**
100
     * @return ArrayCollection|Category[]
101
     */
102 3
    public function getCategories()
103
    {
104 3
        return $this->categories;
105
    }
106 2
107
    /**
108
     * @param ArrayCollection|Category[] $categories
109
     *
110
     * @return SegmentInterface
111
     */
112 3
    public function setCategories($categories)
113
    {
114 3
        $this->categories = $categories;
115
116 1
        return $this;
117
    }
118
119
    /**
120
     * @return ArrayCollection|Product[]
121
     */
122 3
    public function getProducts()
123
    {
124 3
        return $this->products;
125
    }
126 2
127
    /**
128
     * @param ArrayCollection|Product[] $products
129
     *
130
     * @return SegmentInterface
131
     */
132 3
    public function setProducts($products)
133
    {
134 3
        $this->products = $products;
135
136 1
        return $this;
137
    }
138
139
    /**
140 2
     * @return array
141
     */
142 3
    public function getSegmentOptions()
143
    {
144 3
        return $this->segmentOptions;
145
    }
146
147
    /**
148
     * @param array $segmentOptions
149
     *
150
     * @return SegmentInterface
151
     */
152 1
    public function setSegmentOptions(array $segmentOptions)
153
    {
154 1
        $this->segmentOptions = $segmentOptions;
155
156 1
        return $this;
157
    }
158
}
159