1 | <?php |
||
16 | class Tag |
||
17 | { |
||
18 | /** |
||
19 | * @var int |
||
20 | * |
||
21 | * @ORM\Column(type="integer") |
||
22 | * @ORM\Id |
||
23 | * @ORM\GeneratedValue(strategy="AUTO") |
||
24 | */ |
||
25 | protected $id; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | * |
||
30 | * @Assert\NotBlank |
||
31 | * @ORM\Column(type="string", length=255) |
||
32 | */ |
||
33 | protected $name; |
||
34 | |||
35 | /** |
||
36 | * @var News |
||
37 | * |
||
38 | * @ORM\ManyToOne(targetEntity="News", inversedBy="tags") |
||
39 | */ |
||
40 | protected $news; |
||
41 | |||
42 | /** |
||
43 | * @var ArrayCollection|TagElement[] |
||
44 | * |
||
45 | * @ORM\OneToMany(targetEntity="TagElement", mappedBy="tag", cascade={"persist"}, orphanRemoval=true) |
||
46 | */ |
||
47 | protected $elements; |
||
48 | |||
49 | public function __construct() |
||
53 | |||
54 | public function getId(): ?int |
||
58 | |||
59 | public function getName(): ?string |
||
63 | |||
64 | public function setName(?string $name): void |
||
68 | |||
69 | public function getNews(): ?News |
||
73 | |||
74 | public function setNews(?News $news): void |
||
78 | |||
79 | /** |
||
80 | * @return TagElement[]|Collection |
||
81 | */ |
||
82 | public function getElements(): Collection |
||
86 | |||
87 | public function addElement(TagElement $element): void |
||
94 | |||
95 | public function removeElement(TagElement $element): void |
||
100 | } |
||
101 |