Passed
Pull Request — develop (#91)
by Mario
01:16
created

Category::getServices()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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
105
     * @Serializer\Groups({"category_output", "category_input"})
106
     * @Assert\DateTime
107
     */
108
    protected $createdAt;
109
110
    /**
111
     * @var \DateTime
112
     * @ApiProperty(writable=false)
113
     * @Serializer\Groups({"category_output"})
114
     */
115
    protected $updatedAt;
116
117
    /**
118
     * @var \DateTime
119
     * @ApiProperty(writable=false)
120
     * @Serializer\Groups({"category_output"})
121
     */
122
    protected $deletedAt;
123
124
    /**
125
     * @var string
126
     * @ApiProperty
127
     * @Serializer\Groups({"category_output", "category_input"})
128
     * @ORM\Column(name="`owner`", type="string", length=255, nullable=true)
129
     * @Assert\NotBlank
130
     * @Assert\Length(min=1, max=255)
131
     */
132
    private $owner;
0 ignored issues
show
introduced by
The private property $owner is not used, and could be removed.
Loading history...
133
134
    /**
135
     * @var string
136
     * @ApiProperty
137
     * @Serializer\Groups({"category_output", "category_input"})
138
     * @ORM\Column(name="owner_uuid", type="guid", nullable=true)
139
     * @Assert\NotBlank
140
     * @Assert\Uuid
141
     */
142
    private $ownerUuid;
0 ignored issues
show
introduced by
The private property $ownerUuid is not used, and could be removed.
Loading history...
143
144
    /**
145
     * @var string
146
     * @ApiProperty
147
     * @Serializer\Groups({"category_output", "category_input"})
148
     * @ORM\Column(name="slug", type="string")
149
     * @Assert\NotBlank
150
     * @Assert\Length(min=1, max=255)
151
     */
152
    private $slug;
0 ignored issues
show
introduced by
The private property $slug is not used, and could be removed.
Loading history...
153
154
    /**
155
     * @var array
156
     * @ApiProperty
157
     * @Serializer\Groups({"category_output", "category_input"})
158
     * @Assert\Type("array")
159
     * @Assert\NotBlank
160
     * @Assert\All({
161
     *     @Assert\NotBlank,
162
     *     @Assert\Length(min=1)
163
     * })
164
     * @Locale
165
     * @Translate
166
     */
167
    private $title;
168
169
    /**
170
     * @var array
171
     * @ApiProperty
172
     * @Serializer\Groups({"category_output", "category_input"})
173
     * @Assert\Type("array")
174
     * @Assert\NotBlank
175
     * @Assert\All({
176
     *     @Assert\NotBlank,
177
     *     @Assert\Length(min=1)
178
     * })
179
     * @Locale
180
     * @Translate
181
     */
182
    private $description;
183
184
    /**
185
     * @var array
186
     * @ApiProperty
187
     * @Serializer\Groups({"category_output", "category_input"})
188
     * @Assert\Type("array")
189
     * @Assert\NotBlank
190
     * @Assert\All({
191
     *     @Assert\NotBlank,
192
     *     @Assert\Length(min=1)
193
     * })
194
     * @Locale
195
     * @Translate
196
     */
197
    private $presentation;
198
199
    /**
200
     * @var array
201
     * @ApiProperty
202
     * @Serializer\Groups({"category_output", "category_input"})
203
     * @Assert\Type("array")
204
     * @Assert\NotBlank
205
     * @Locale
206
     * @Translate
207
     */
208
    private $data;
209
210
    /**
211
     * @var \Doctrine\Common\Collections\ArrayCollection
212
     * @ApiProperty
213
     * @Serializer\Groups({"category_output", "category_input"})
214
     * @ORM\ManyToMany(targetEntity="Service", mappedBy="categories")
215
     * @ORM\Cache(usage="NONSTRICT_READ_WRITE")
216
     */
217
    private $services; # region accessors
218
219
    /**
220
     * Add service
221
     *
222
     * @param \App\Entity\Service $service
223
     * @return \App\Entity\Category
224
     */
225
    public function addService(Service $service)
226
    {
227
        if (!$this->services->contains($service)) {
228
            $this->services->add($service);
229
            $service->addCategory($this);
230
        }
231
232
        return $this;
233
    }
234
    /**
235
     * Remove service
236
     *
237
     * @param \App\Entity\Service $service
238
     * @return \App\Entity\Category
239
     */
240
    public function removeService(Service $service)
241
    {
242
        if ($this->services->contains($service)) {
243
            $this->services->removeElement($service);
244
            $service->removeCategory($this);
245
        }
246
247
        return $this;
248
    }
249
250
    /**
251
     * Get services
252
     *
253
     * @return \Doctrine\Common\Collections\ArrayCollection
254
     */
255
    public function getServices()
256
    {
257
        return $this->services;
258
    }
259
260
    # endregion
261
262
    /**
263
     * @var string
264
     * @Serializer\Groups({"category_output", "category_input"})
265
     * @ORM\Column(name="enabled", type="boolean")
266
     * @Assert\Type("boolean")
267
     */
268
    private $enabled;
269
270
    /**
271
     * @var integer
272
     * @ApiProperty
273
     * @Serializer\Groups({"category_output", "category_input"})
274
     * @ORM\Column(name="weight", type="smallint")
275
     * @Assert\Length(min=0, max=255)
276
     */
277
    private $weight;
278
279
    /**
280
     * @var integer
281
     * @ApiProperty
282
     * @Serializer\Groups({"category_output", "category_input"})
283
     * @ORM\Column(name="version", type="integer")
284
     * @ORM\Version
285
     * @Assert\NotBlank
286
     * @Assert\Type("integer")
287
     */
288
    private $version;
0 ignored issues
show
introduced by
The private property $version is not used, and could be removed.
Loading history...
289
290
    /**
291
     * @var string
292
     * @ApiProperty(writable=false)
293
     * @Serializer\Groups({"category_output"})
294
     * @ORM\Column(name="tenant", type="guid")
295
     * @Assert\Uuid
296
     */
297
    private $tenant;
0 ignored issues
show
introduced by
The private property $tenant is not used, and could be removed.
Loading history...
298
299
    /**
300
     * Constructor
301
     */
302
    public function __construct()
303
    {
304
        $this->title = [];
305
        $this->description = [];
306
        $this->presentation = [];
307
        $this->data = [];
308
        $this->services = new ArrayCollection;
309
        $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...
310
        $this->weight = 0;
311
    }
312
}
313