| Total Complexity | 10 |
| Total Lines | 71 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 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 |
||
| 86 | } |
||
| 87 | } |
||
| 88 |