]> Raphaƫl G. Git Repositories - blogbundle/blob - Entity/Author.php
Switch from hello world page to new index
[blogbundle] / Entity / Author.php
1 <?php
2
3 namespace Rapsys\BlogBundle\Entity;
4
5 /**
6 * Author
7 */
8 class Author
9 {
10 /**
11 * @var integer
12 */
13 private $id;
14
15 /**
16 * @var string
17 */
18 private $name;
19
20 /**
21 * @var \DateTime
22 */
23 private $created;
24
25 /**
26 * @var \DateTime
27 */
28 private $updated;
29
30 /**
31 * @var \Doctrine\Common\Collections\Collection
32 */
33 private $articles;
34
35 /**
36 * @var \Doctrine\Common\Collections\Collection
37 */
38 private $author_translations;
39
40 /**
41 * Constructor
42 */
43 public function __construct()
44 {
45 $this->articles = new \Doctrine\Common\Collections\ArrayCollection();
46 $this->author_translations = new \Doctrine\Common\Collections\ArrayCollection();
47 }
48
49 /**
50 * Get id
51 *
52 * @return integer
53 */
54 public function getId()
55 {
56 return $this->id;
57 }
58
59 /**
60 * Set name
61 *
62 * @param string $name
63 *
64 * @return Author
65 */
66 public function setName($name)
67 {
68 $this->name = $name;
69
70 return $this;
71 }
72
73 /**
74 * Get name
75 *
76 * @return string
77 */
78 public function getName()
79 {
80 return $this->name;
81 }
82
83 /**
84 * Set created
85 *
86 * @param \DateTime $created
87 *
88 * @return Author
89 */
90 public function setCreated($created)
91 {
92 $this->created = $created;
93
94 return $this;
95 }
96
97 /**
98 * Get created
99 *
100 * @return \DateTime
101 */
102 public function getCreated()
103 {
104 return $this->created;
105 }
106
107 /**
108 * Set updated
109 *
110 * @param \DateTime $updated
111 *
112 * @return Author
113 */
114 public function setUpdated($updated)
115 {
116 $this->updated = $updated;
117
118 return $this;
119 }
120
121 /**
122 * Get updated
123 *
124 * @return \DateTime
125 */
126 public function getUpdated()
127 {
128 return $this->updated;
129 }
130
131 /**
132 * Add article
133 *
134 * @param \Rapsys\BlogBundle\Entity\Article $article
135 *
136 * @return Author
137 */
138 public function addArticle(\Rapsys\BlogBundle\Entity\Article $article)
139 {
140 $this->articles[] = $article;
141
142 return $this;
143 }
144
145 /**
146 * Remove article
147 *
148 * @param \Rapsys\BlogBundle\Entity\Article $article
149 */
150 public function removeArticle(\Rapsys\BlogBundle\Entity\Article $article)
151 {
152 $this->articles->removeElement($article);
153 }
154
155 /**
156 * Get articles
157 *
158 * @return \Doctrine\Common\Collections\Collection
159 */
160 public function getArticles()
161 {
162 return $this->articles;
163 }
164
165 /**
166 * Add authorTranslation
167 *
168 * @param \Rapsys\BlogBundle\Entity\AuthorTranslation $authorTranslation
169 *
170 * @return Author
171 */
172 public function addAuthorTranslation(\Rapsys\BlogBundle\Entity\AuthorTranslation $authorTranslation)
173 {
174 $this->author_translations[] = $authorTranslation;
175
176 return $this;
177 }
178
179 /**
180 * Remove authorTranslation
181 *
182 * @param \Rapsys\BlogBundle\Entity\AuthorTranslation $authorTranslation
183 */
184 public function removeAuthorTranslation(\Rapsys\BlogBundle\Entity\AuthorTranslation $authorTranslation)
185 {
186 $this->author_translations->removeElement($authorTranslation);
187 }
188
189 /**
190 * Get authorTranslations
191 *
192 * @return \Doctrine\Common\Collections\Collection
193 */
194 public function getAuthorTranslations()
195 {
196 return $this->author_translations;
197 }
198
199 /**
200 * Set id
201 *
202 * @param integer $id
203 *
204 * @return Author
205 */
206 public function setId($id)
207 {
208 $this->id = $id;
209
210 return $this;
211 }
212 /**
213 * @var string
214 */
215 private $slug;
216
217
218 /**
219 * Set slug
220 *
221 * @param string $slug
222 *
223 * @return Author
224 */
225 public function setSlug($slug)
226 {
227 $this->slug = $slug;
228
229 return $this;
230 }
231
232 /**
233 * Get slug
234 *
235 * @return string
236 */
237 public function getSlug()
238 {
239 return $this->slug;
240 }
241 }