Feature::getIcon()   A
last analyzed

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
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Entity;
6
7
use App\Entity\Traits\EntityIdTrait;
8
use Doctrine\Common\Collections\ArrayCollection;
9
use Doctrine\Common\Collections\Collection;
10
use Doctrine\ORM\Mapping as ORM;
11
12
/**
13
 * @ORM\Entity(repositoryClass="App\Repository\FeatureRepository")
14
 */
15
class Feature
16
{
17
    use EntityIdTrait;
18
19
    /**
20
     * @ORM\Column(type="string", length=255)
21
     */
22
    private ?string $name;
23
24
    /**
25
     * @ORM\ManyToMany(targetEntity="App\Entity\Property", mappedBy="features")
26
     */
27
    private $properties;
28
29
    /**
30
     * @ORM\Column(type="text", nullable=true)
31
     */
32
    private ?string $icon;
33
34
    public function __construct()
35
    {
36
        $this->properties = new ArrayCollection();
37
    }
38
39
    public function getName(): ?string
40
    {
41
        return $this->name;
42
    }
43
44
    public function setName(string $name): self
45
    {
46
        $this->name = $name;
47
48
        return $this;
49
    }
50
51
    public function getProperties(): Collection
52
    {
53
        return $this->properties;
54
    }
55
56
    public function addProperty(Property $property): self
57
    {
58
        if (!$this->properties->contains($property)) {
59
            $this->properties[] = $property;
60
            $property->addFeature($this);
61
        }
62
63
        return $this;
64
    }
65
66
    public function removeProperty(Property $property): self
67
    {
68
        if ($this->properties->contains($property)) {
69
            $this->properties->removeElement($property);
70
            $property->removeFeature($this);
71
        }
72
73
        return $this;
74
    }
75
76
    public function getIcon(): ?string
77
    {
78
        return $this->icon;
79
    }
80
81
    public function setIcon(?string $icon): self
82
    {
83
        $this->icon = $icon;
84
85
        return $this;
86
    }
87
}
88