Total Complexity | 7 |
Total Lines | 62 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
22 | class Tag |
||
23 | { |
||
24 | /** |
||
25 | * @Column(type="primary") |
||
26 | * @var int |
||
27 | */ |
||
28 | private $id; |
||
29 | |||
30 | /** |
||
31 | * @Column(type="string(255)") |
||
32 | * @var string |
||
33 | */ |
||
34 | private $label; |
||
35 | |||
36 | /** |
||
37 | * @Column(type="datetime") |
||
38 | * @var DateTimeImmutable |
||
39 | */ |
||
40 | private $createdAt; |
||
41 | |||
42 | /** |
||
43 | * @ManyToMany(target="App\Blog\Entity\Post", though="PostTag", fkAction="CASCADE", indexCreate=false) |
||
44 | * @var PivotedCollection |
||
45 | */ |
||
46 | private $posts; |
||
47 | |||
48 | public function __construct() |
||
49 | { |
||
50 | $this->posts = new PivotedCollection(); |
||
51 | } |
||
52 | |||
53 | public function getId(): ?string |
||
56 | } |
||
57 | |||
58 | public function getLabel(): string |
||
59 | { |
||
60 | return $this->label; |
||
61 | } |
||
62 | |||
63 | public function setLabel(string $label): void |
||
64 | { |
||
65 | $this->label = $label; |
||
66 | } |
||
67 | |||
68 | public function getCreatedAt(): DateTimeImmutable |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * @return ArrayCollection|Post[] |
||
75 | */ |
||
76 | public function getPosts(): ArrayCollection |
||
77 | { |
||
78 | return $this->posts; |
||
79 | } |
||
80 | |||
81 | public function addPost(Post $post): void |
||
84 | } |
||
85 | } |
||
86 |