123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <?php
- namespace Translatable\Fixture;
- use Gedmo\Translatable\Translatable;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * @ORM\Entity
- */
- class Article implements Translatable
- {
- /** @ORM\Id @ORM\GeneratedValue @ORM\Column(type="integer") */
- private $id;
- /**
- * @Gedmo\Translatable
- * @ORM\Column(name="title", type="string", length=128)
- */
- private $title;
- /**
- * @Gedmo\Translatable
- * @ORM\Column(name="content", type="text", nullable=true)
- */
- private $content;
- /**
- * @Gedmo\Translatable(fallback=false)
- * @ORM\Column(name="views", type="integer", nullable=true)
- */
- private $views;
- /**
- * @Gedmo\Translatable(fallback=true)
- * @ORM\Column(name="author", type="string", nullable=true)
- */
- private $author;
- /**
- * Used locale to override Translation listener`s locale
- * @Gedmo\Locale
- */
- private $locale;
- /**
- * @ORM\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;
- }
- public function setViews ($views)
- {
- $this->views = $views;
- }
- public function getViews ()
- {
- return $this->views;
- }
- public function setAuthor($author)
- {
- $this->author = $author;
- }
- public function getAuthor()
- {
- return $this->author;
- }
- }
|