123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- namespace Translatable\Fixture;
- use Gedmo\Translatable\Translatable;
- /**
- * @Entity
- */
- class Article implements Translatable
- {
- /** @Id @GeneratedValue @Column(type="integer") */
- private $id;
- /**
- * @gedmo:Translatable
- * @Column(name="title", type="string", length=128)
- */
- private $title;
- /**
- * @gedmo:Translatable
- * @Column(name="content", type="text")
- */
- private $content;
-
- /**
- * Used locale to override Translation listener`s locale
- * @gedmo:Locale
- */
- private $locale;
-
- /**
- * @OneToMany(targetEntity="Comment", mappedBy="article")
- */
- private $comments;
- public function getId()
- {
- return $this->id;
- }
- public function addComment(Comment $comment)
- {
- $comment->setArticle($this);
- $this->comments[] = $comment;
- }
- public function getComments()
- {
- return $this->comments;
- }
-
- public function setTitle($title)
- {
- $this->title = $title;
- }
- public function getTitle()
- {
- return $this->title;
- }
- public function setContent($content)
- {
- $this->content = $content;
- }
- public function getContent()
- {
- return $this->content;
- }
-
- public function setTranslatableLocale($locale)
- {
- $this->locale = $locale;
- }
- }
|