Person.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. namespace SoftDeleteable\Fixture\Entity;
  3. use Gedmo\Mapping\Annotation as Gedmo;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity
  7. * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=true)
  8. */
  9. class Person
  10. {
  11. /**
  12. * @ORM\Column(type="integer")
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. */
  16. private $id;
  17. /**
  18. * @ORM\Column(length=32)
  19. */
  20. private $name;
  21. /**
  22. * @ORM\Column(type="datetime", nullable=true)
  23. */
  24. private $deletedAt;
  25. /**
  26. * @ORM\OneToOne(targetEntity="Address", inversedBy="owner", cascade={"remove"})
  27. */
  28. private $address;
  29. public function getId()
  30. {
  31. return $this->id;
  32. }
  33. public function setName($name)
  34. {
  35. $this->name = $name;
  36. return $this;
  37. }
  38. public function getName()
  39. {
  40. return $this->name;
  41. }
  42. public function setAddress(Address $address)
  43. {
  44. $this->address = $address;
  45. $address->setOwner($this);
  46. return $this;
  47. }
  48. public function getAddress()
  49. {
  50. return $this->address;
  51. }
  52. public function setDeletedAt($deletedAt)
  53. {
  54. $this->deletedAt = $deletedAt;
  55. return $this;
  56. }
  57. public function getDeletedAt()
  58. {
  59. return $this->deletedAt;
  60. }
  61. }