Comment.php 727 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace JMS\Serializer\Tests\Fixtures\Doctrine;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /** @ORM\Entity */
  6. class Comment
  7. {
  8. /**
  9. * @ORM\Id @ORM\Column(type="integer")
  10. */
  11. protected $id;
  12. /**
  13. * @ORM\Column(type="Author")
  14. */
  15. private $author;
  16. /** @ORM\ManyToOne(targetEntity="BlogPost") */
  17. private $blogPost;
  18. /**
  19. * @ORM\Column(type="string")
  20. */
  21. private $text;
  22. public function __construct(Author $author, $text)
  23. {
  24. $this->author = $author;
  25. $this->text = $text;
  26. $this->blogPost = new ArrayCollection();
  27. }
  28. public function getAuthor()
  29. {
  30. return $this->author;
  31. }
  32. }