1 | <?php |
||
20 | class Post extends AbstractTranslateableStory |
||
21 | { |
||
22 | use DeletedByTrait; |
||
23 | |||
24 | /** |
||
25 | * @var integer |
||
26 | * |
||
27 | * @ORM\Column(name="id", type="integer") |
||
28 | * @ORM\Id |
||
29 | * @ORM\GeneratedValue(strategy="AUTO") |
||
30 | */ |
||
31 | protected $id; |
||
32 | |||
33 | /** |
||
34 | * @var ArrayCollection|PostTranslation[] |
||
35 | * |
||
36 | * @ORM\OneToMany( |
||
37 | * targetEntity="AppBundle\Entity\Translations\PostTranslation", |
||
38 | * mappedBy="object", |
||
39 | * cascade={"persist", "remove"} |
||
40 | * ) |
||
41 | */ |
||
42 | protected $translations; |
||
43 | |||
44 | /** |
||
45 | * @var ArrayCollection|GalleryHasMedia[] |
||
46 | * |
||
47 | * @ORM\ManyToMany(targetEntity="Application\Sonata\MediaBundle\Entity\GalleryHasMedia", cascade={"persist"}) |
||
48 | * @ORM\JoinTable(name="post_galleryHasMedia", |
||
49 | * joinColumns={@ORM\JoinColumn(name="post_id",referencedColumnName="id")}, |
||
50 | * inverseJoinColumns={@ORM\JoinColumn(name="galleryHasMedia_id",referencedColumnName="id")} |
||
51 | * ) |
||
52 | */ |
||
53 | protected $galleryHasMedia; |
||
54 | |||
55 | /** |
||
56 | * @var ArrayCollection|Tag[] |
||
57 | * |
||
58 | * @ORM\ManyToMany(targetEntity="AppBundle\Entity\Tag", inversedBy="posts", cascade={"persist"}) |
||
59 | * @Serializer\Expose |
||
60 | */ |
||
61 | protected $tags; |
||
62 | |||
63 | /** |
||
64 | * @var bool |
||
65 | * |
||
66 | * @ORM\Column(name="pinned", type="boolean") |
||
67 | * @Serializer\Type("boolean") |
||
68 | * @Serializer\Expose |
||
69 | */ |
||
70 | protected $pinned = false; |
||
71 | |||
72 | /** |
||
73 | * Constructor |
||
74 | */ |
||
75 | public function __construct() |
||
76 | { |
||
77 | parent::__construct(); |
||
78 | $this->galleryHasMedia = new ArrayCollection(); |
||
79 | $this->tags = new ArrayCollection(); |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * Get id |
||
84 | * |
||
85 | 1 | * @return integer |
|
86 | */ |
||
87 | 1 | public function getId() |
|
91 | |||
92 | /** |
||
93 | * Unset translations |
||
94 | * |
||
95 | 4 | * @return Post |
|
96 | */ |
||
97 | 4 | public function unsetTranslations() |
|
103 | |||
104 | /** |
||
105 | * Add galleryHasMedia |
||
106 | * |
||
107 | * @param \Application\Sonata\MediaBundle\Entity\GalleryHasMedia $galleryHasMedia |
||
108 | * @return self |
||
109 | */ |
||
110 | public function addGalleryHasMedia(\Application\Sonata\MediaBundle\Entity\GalleryHasMedia $galleryHasMedia) |
||
116 | |||
117 | /** |
||
118 | * Remove galleryHasMedia |
||
119 | * |
||
120 | * @param \Application\Sonata\MediaBundle\Entity\GalleryHasMedia $galleryHasMedia |
||
121 | */ |
||
122 | public function removeGalleryHasMedia(\Application\Sonata\MediaBundle\Entity\GalleryHasMedia $galleryHasMedia) |
||
126 | |||
127 | /** |
||
128 | * Get galleryHasMedia |
||
129 | * |
||
130 | 5 | * @return \Doctrine\Common\Collections\Collection |
|
131 | */ |
||
132 | 5 | public function getGalleryHasMedia() |
|
136 | |||
137 | /** |
||
138 | * Add tags |
||
139 | * |
||
140 | * @param \AppBundle\Entity\Tag $tags |
||
141 | * @return self |
||
142 | */ |
||
143 | public function addTag(\AppBundle\Entity\Tag $tags) |
||
149 | |||
150 | /** |
||
151 | * Remove tags |
||
152 | * |
||
153 | * @param \AppBundle\Entity\Tag $tags |
||
154 | */ |
||
155 | public function removeTag(\AppBundle\Entity\Tag $tags) |
||
159 | |||
160 | /** |
||
161 | * Get tags |
||
162 | * |
||
163 | 4 | * @return \Doctrine\Common\Collections\Collection |
|
164 | */ |
||
165 | 4 | public function getTags() |
|
169 | |||
170 | /** |
||
171 | * @param boolean $pinned |
||
172 | 1 | * @return Post |
|
173 | */ |
||
174 | 1 | public function setPinned($pinned) |
|
180 | |||
181 | /** |
||
182 | * @return boolean |
||
183 | */ |
||
184 | public function isPinned() |
||
188 | } |
||
189 |