OtherArticle.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace SoftDeleteable\Fixture\Entity;
  3. use Gedmo\Mapping\Annotation as Gedmo;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. /**
  7. * @ORM\Entity
  8. * @Gedmo\SoftDeleteable(fieldName="deletedAt")
  9. */
  10. class OtherArticle
  11. {
  12. /**
  13. * @ORM\Column(name="id", type="integer")
  14. * @ORM\Id
  15. * @ORM\GeneratedValue(strategy="IDENTITY")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(name="title", type="string")
  20. */
  21. private $title;
  22. /**
  23. * @ORM\Column(name="deletedAt", type="datetime", nullable=true)
  24. */
  25. private $deletedAt;
  26. /**
  27. * @ORM\OneToMany(targetEntity="OtherComment", mappedBy="article")
  28. */
  29. private $comments;
  30. public function __construct()
  31. {
  32. $this->comments = new ArrayCollection();
  33. }
  34. public function getId()
  35. {
  36. return $this->id;
  37. }
  38. public function setTitle($title)
  39. {
  40. $this->title = $title;
  41. }
  42. public function getTitle()
  43. {
  44. return $this->title;
  45. }
  46. public function setDeletedAt($deletedAt)
  47. {
  48. $this->deletedAt = $deletedAt;
  49. }
  50. public function getDeletedAt()
  51. {
  52. return $this->deletedAt;
  53. }
  54. public function addComment(OtherComment $comment)
  55. {
  56. $this->comments[] = $comment;
  57. }
  58. }