| Total Complexity | 7 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | class Category |
||
| 19 | { |
||
| 20 | use EntityIdTrait; |
||
| 21 | use EntityNameTrait; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @ORM\OneToMany(targetEntity="App\Entity\Property", mappedBy="category") |
||
| 25 | */ |
||
| 26 | private $properties; |
||
| 27 | |||
| 28 | public function __construct() |
||
| 31 | } |
||
| 32 | |||
| 33 | public function getProperties(): Collection |
||
| 34 | { |
||
| 35 | return $this->properties; |
||
| 36 | } |
||
| 37 | |||
| 38 | public function addProperty(Property $property): self |
||
| 39 | { |
||
| 40 | if (!$this->properties->contains($property)) { |
||
| 41 | $this->properties[] = $property; |
||
| 42 | $property->setCategory($this); |
||
| 43 | } |
||
| 44 | |||
| 45 | return $this; |
||
| 46 | } |
||
| 47 | |||
| 48 | public function removeProperty(Property $property): self |
||
| 59 | } |
||
| 60 | } |
||
| 61 |