1 | <?php |
||
24 | class Category |
||
25 | { |
||
26 | use ContentTrait; |
||
27 | use SeoTrait; |
||
28 | use ImageTrait; |
||
29 | |||
30 | /** |
||
31 | * @var int |
||
32 | * |
||
33 | * @ORM\Id |
||
34 | * @ORM\Column(name="id", type="integer") |
||
35 | * @ORM\GeneratedValue(strategy="AUTO") |
||
36 | */ |
||
37 | protected $id; |
||
38 | |||
39 | /** |
||
40 | * @var ArrayCollection|Post[] |
||
41 | * |
||
42 | * @ORM\OneToMany(targetEntity="Smart\ContentBundle\Entity\Post", mappedBy="category") |
||
43 | */ |
||
44 | protected $posts; |
||
45 | |||
46 | 1 | public function __construct() |
|
50 | |||
51 | /** |
||
52 | * @return string |
||
53 | */ |
||
54 | public function __toString() |
||
58 | |||
59 | /** |
||
60 | * @return ArrayCollection|Post[] |
||
61 | */ |
||
62 | public function getPosts() |
||
66 | |||
67 | /** |
||
68 | * @param ArrayCollection|Post[] $posts |
||
69 | * |
||
70 | * @return $this |
||
71 | */ |
||
72 | public function setPosts($posts) |
||
80 | |||
81 | /** |
||
82 | * @param Post $post |
||
83 | * |
||
84 | * @return $this |
||
85 | */ |
||
86 | public function addPost($post) |
||
94 | } |
||
95 |