Category   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 248
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 51
dl 0
loc 248
rs 10
c 0
b 0
f 0
wmc 6

3 Methods

Rating   Name   Duplication   Size   Complexity  
A removeService() 0 8 2
A getServices() 0 3 1
A addService() 0 8 2
1
<?php
2
3
namespace App\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\Collections\ArrayCollection 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...
6
use Ds\Component\Locale\Model\Type\Localizable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Locale\Model\Type\Localizable 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...
7
use Ds\Component\Model\Attribute\Accessor;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor 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 Ds\Component\Model\Type\Deletable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Type\Deletable 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 Ds\Component\Model\Type\Enableable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Type\Enableable 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 Ds\Component\Model\Type\Identifiable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Type\Identifiable 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
use Ds\Component\Model\Type\Ownable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Type\Ownable 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...
12
use Ds\Component\Model\Type\Sluggable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Type\Sluggable 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...
13
use Ds\Component\Model\Type\Uuidentifiable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Type\Uuidentifiable 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...
14
use Ds\Component\Model\Type\Versionable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Type\Versionable 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...
15
use Ds\Component\Tenant\Model\Attribute\Accessor as TenantAccessor;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Tenant\Model\Attribute\Accessor 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...
16
use Ds\Component\Tenant\Model\Type\Tenantable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Tenant\Model\Type\Tenantable 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...
17
use Ds\Component\Translation\Model\Attribute\Accessor as TranslationAccessor;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Translation\Model\Attribute\Accessor 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...
18
use Ds\Component\Translation\Model\Type\Translatable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Translation\Model\Type\Translatable 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...
19
use Knp\DoctrineBehaviors\Model as Behavior;
0 ignored issues
show
Bug introduced by
The type Knp\DoctrineBehaviors\Model 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...
20
21
use ApiPlatform\Core\Annotation\ApiResource;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Core\Annotation\ApiResource 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...
22
use ApiPlatform\Core\Annotation\ApiProperty;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Core\Annotation\ApiProperty 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...
23
use Doctrine\ORM\Mapping as ORM;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping 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...
24
use Ds\Component\Locale\Model\Annotation\Locale;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Locale\Model\Annotation\Locale 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...
25
use Ds\Component\Translation\Model\Annotation\Translate;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Translation...el\Annotation\Translate 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...
26
use Symfony\Bridge\Doctrine\Validator\Constraints as ORMAssert;
0 ignored issues
show
Bug introduced by
The type Symfony\Bridge\Doctrine\Validator\Constraints 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...
27
use Symfony\Component\Serializer\Annotation as Serializer;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Serializer\Annotation 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...
28
use Symfony\Component\Validator\Constraints as Assert;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Validator\Constraints 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...
29
30
/**
31
 * Class Category
32
 *
33
 * @ApiResource(
34
 *     attributes={
35
 *         "normalization_context"={
36
 *             "groups"={"category_output"}
37
 *         },
38
 *         "denormalization_context"={
39
 *             "groups"={"category_input"}
40
 *         },
41
 *         "filters"={
42
 *             "app.category.search",
43
 *             "app.category.search_translation",
44
 *             "app.category.date",
45
 *             "app.category.boolean",
46
 *             "app.category.order",
47
 *             "app.category.order_translation"
48
 *         }
49
 *     }
50
 * )
51
 * @ORM\Entity(repositoryClass="App\Repository\CategoryRepository")
52
 * @ORM\Table(
53
 *     name="app_category",
54
 *     uniqueConstraints={
55
 *        @ORM\UniqueConstraint(columns={"slug", "tenant"})
56
 *    }
57
 * )
58
 * @ORM\Cache(usage="NONSTRICT_READ_WRITE")
59
 * @ORMAssert\UniqueEntity(fields="uuid")
60
 * @ORMAssert\UniqueEntity(fields={"slug", "tenant"})
61
 */
62
class Category implements Identifiable, Uuidentifiable, Sluggable, Ownable, Translatable, Localizable, Enableable, Deletable, Versionable, Tenantable
63
{
64
    use Behavior\Translatable\Translatable;
0 ignored issues
show
Bug introduced by
The type Knp\DoctrineBehaviors\Mo...anslatable\Translatable 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...
65
    use Behavior\Timestampable\Timestampable;
0 ignored issues
show
Bug introduced by
The type Knp\DoctrineBehaviors\Mo...stampable\Timestampable 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...
66
    use Behavior\SoftDeletable\SoftDeletable;
0 ignored issues
show
Bug introduced by
The type Knp\DoctrineBehaviors\Mo...Deletable\SoftDeletable 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...
67
68
    use Accessor\Id;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\Id 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...
69
    use Accessor\Uuid;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\Uuid 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...
70
    use Accessor\Owner;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\Owner 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...
71
    use Accessor\OwnerUuid;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\OwnerUuid 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...
72
    use Accessor\Slug;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\Slug 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...
73
    use TranslationAccessor\Title;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Translation...ttribute\Accessor\Title 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...
74
    use TranslationAccessor\Description;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Translation...te\Accessor\Description 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...
75
    use TranslationAccessor\Presentation;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Translation...e\Accessor\Presentation 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...
76
    use TranslationAccessor\Data;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Translation...Attribute\Accessor\Data 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...
77
    use Accessor\Enabled;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\Enabled 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...
78
    use Accessor\Deleted;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\Deleted 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...
79
    use Accessor\Weight;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\Weight 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...
80
    use Accessor\Version;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\Version 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...
81
    use TenantAccessor\Tenant;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Tenant\Mode...tribute\Accessor\Tenant 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...
82
83
    /**
84
     * @var integer
85
     * @ApiProperty(identifier=false, writable=false)
86
     * @Serializer\Groups({"category_output"})
87
     * @ORM\Id
88
     * @ORM\GeneratedValue(strategy="AUTO")
89
     * @ORM\Column(name="id", type="integer")
90
     */
91
    private $id;
0 ignored issues
show
introduced by
The private property $id is not used, and could be removed.
Loading history...
92
93
    /**
94
     * @var string
95
     * @ApiProperty(identifier=true, writable=false)
96
     * @Serializer\Groups({"category_output"})
97
     * @ORM\Column(name="uuid", type="guid", unique=true)
98
     * @Assert\Uuid
99
     */
100
    private $uuid;
0 ignored issues
show
introduced by
The private property $uuid is not used, and could be removed.
Loading history...
101
102
    /**
103
     * @var \DateTime
104
     * @ApiProperty(writable=false)
105
     * @Serializer\Groups({"category_output"})
106
     */
107
    protected $createdAt;
108
109
    /**
110
     * @var \DateTime
111
     * @ApiProperty(writable=false)
112
     * @Serializer\Groups({"category_output"})
113
     */
114
    protected $updatedAt;
115
116
    /**
117
     * @var \DateTime
118
     * @ApiProperty(writable=false)
119
     * @Serializer\Groups({"category_output"})
120
     */
121
    protected $deletedAt;
122
123
    /**
124
     * @var string
125
     * @ApiProperty
126
     * @Serializer\Groups({"category_output", "category_input"})
127
     * @ORM\Column(name="`owner`", type="string", length=255, nullable=true)
128
     * @Assert\NotBlank
129
     * @Assert\Length(min=1, max=255)
130
     */
131
    private $owner;
0 ignored issues
show
introduced by
The private property $owner is not used, and could be removed.
Loading history...
132
133
    /**
134
     * @var string
135
     * @ApiProperty
136
     * @Serializer\Groups({"category_output", "category_input"})
137
     * @ORM\Column(name="owner_uuid", type="guid", nullable=true)
138
     * @Assert\NotBlank
139
     * @Assert\Uuid
140
     */
141
    private $ownerUuid;
0 ignored issues
show
introduced by
The private property $ownerUuid is not used, and could be removed.
Loading history...
142
143
    /**
144
     * @var string
145
     * @ApiProperty
146
     * @Serializer\Groups({"category_output", "category_input"})
147
     * @ORM\Column(name="slug", type="string")
148
     * @Assert\NotBlank
149
     * @Assert\Length(min=1, max=255)
150
     */
151
    private $slug;
0 ignored issues
show
introduced by
The private property $slug is not used, and could be removed.
Loading history...
152
153
    /**
154
     * @var array
155
     * @ApiProperty
156
     * @Serializer\Groups({"category_output", "category_input"})
157
     * @Assert\Type("array")
158
     * @Assert\NotBlank
159
     * @Assert\All({
160
     *     @Assert\NotBlank,
161
     *     @Assert\Length(min=1)
162
     * })
163
     * @Locale
164
     * @Translate
165
     */
166
    private $title;
167
168
    /**
169
     * @var array
170
     * @ApiProperty
171
     * @Serializer\Groups({"category_output", "category_input"})
172
     * @Assert\Type("array")
173
     * @Assert\NotBlank
174
     * @Assert\All({
175
     *     @Assert\NotBlank,
176
     *     @Assert\Length(min=1)
177
     * })
178
     * @Locale
179
     * @Translate
180
     */
181
    private $description;
182
183
    /**
184
     * @var array
185
     * @ApiProperty
186
     * @Serializer\Groups({"category_output", "category_input"})
187
     * @Assert\Type("array")
188
     * @Assert\NotBlank
189
     * @Assert\All({
190
     *     @Assert\NotBlank,
191
     *     @Assert\Length(min=1)
192
     * })
193
     * @Locale
194
     * @Translate
195
     */
196
    private $presentation;
197
198
    /**
199
     * @var array
200
     * @ApiProperty
201
     * @Serializer\Groups({"category_output", "category_input"})
202
     * @Assert\Type("array")
203
     * @Assert\NotBlank
204
     * @Locale
205
     * @Translate
206
     */
207
    private $data;
208
209
    /**
210
     * @var \Doctrine\Common\Collections\ArrayCollection
211
     * @ApiProperty
212
     * @Serializer\Groups({"category_output", "category_input"})
213
     * @ORM\ManyToMany(targetEntity="Service", mappedBy="categories")
214
     * @ORM\Cache(usage="NONSTRICT_READ_WRITE")
215
     */
216
    private $services; # region accessors
217
218
    /**
219
     * Add service
220
     *
221
     * @param \App\Entity\Service $service
222
     * @return \App\Entity\Category
223
     */
224
    public function addService(Service $service)
225
    {
226
        if (!$this->services->contains($service)) {
227
            $this->services->add($service);
228
            $service->addCategory($this);
229
        }
230
231
        return $this;
232
    }
233
    /**
234
     * Remove service
235
     *
236
     * @param \App\Entity\Service $service
237
     * @return \App\Entity\Category
238
     */
239
    public function removeService(Service $service)
240
    {
241
        if ($this->services->contains($service)) {
242
            $this->services->removeElement($service);
243
            $service->removeCategory($this);
244
        }
245
246
        return $this;
247
    }
248
249
    /**
250
     * Get services
251
     *
252
     * @return \Doctrine\Common\Collections\ArrayCollection
253
     */
254
    public function getServices()
255
    {
256
        return $this->services;
257
    }
258
259
    # endregion
260
261
    /**
262
     * @var string
263
     * @Serializer\Groups({"category_output", "category_input"})
264
     * @ORM\Column(name="enabled", type="boolean")
265
     * @Assert\Type("boolean")
266
     */
267
    private $enabled;
268
269
    /**
270
     * @var integer
271
     * @ApiProperty
272
     * @Serializer\Groups({"category_output", "category_input"})
273
     * @ORM\Column(name="weight", type="smallint")
274
     * @Assert\Length(min=0, max=255)
275
     */
276
    private $weight;
277
278
    /**
279
     * @var integer
280
     * @ApiProperty
281
     * @Serializer\Groups({"category_output", "category_input"})
282
     * @ORM\Column(name="version", type="integer")
283
     * @ORM\Version
284
     * @Assert\NotBlank
285
     * @Assert\Type("integer")
286
     */
287
    private $version;
0 ignored issues
show
introduced by
The private property $version is not used, and could be removed.
Loading history...
288
289
    /**
290
     * @var string
291
     * @ApiProperty(writable=false)
292
     * @Serializer\Groups({"category_output"})
293
     * @ORM\Column(name="tenant", type="guid")
294
     * @Assert\Uuid
295
     */
296
    private $tenant;
0 ignored issues
show
introduced by
The private property $tenant is not used, and could be removed.
Loading history...
297
298
    /**
299
     * Constructor
300
     */
301
    public function __construct()
302
    {
303
        $this->title = [];
304
        $this->description = [];
305
        $this->presentation = [];
306
        $this->data = [];
307
        $this->services = new ArrayCollection;
308
        $this->enabled = false;
0 ignored issues
show
Documentation Bug introduced by
The property $enabled was declared of type string, but false is of type false. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
309
        $this->weight = 0;
310
    }
311
}
312