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