Address.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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")
  8. */
  9. class Address
  10. {
  11. /**
  12. * @ORM\Column(type="integer")
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. */
  16. private $id;
  17. /**
  18. * @ORM\Column(length=128)
  19. */
  20. private $street;
  21. /**
  22. * @ORM\Column(type="datetime", nullable=true)
  23. */
  24. private $deletedAt;
  25. /**
  26. * @ORM\OneToOne(targetEntity="Person", mappedBy="address", cascade={"remove"})
  27. */
  28. private $owner;
  29. public function getId()
  30. {
  31. return $this->id;
  32. }
  33. public function setStreet($street)
  34. {
  35. $this->street = $street;
  36. return $this;
  37. }
  38. public function getStreet()
  39. {
  40. return $this->street;
  41. }
  42. public function setDeletedAt($deletedAt)
  43. {
  44. $this->deletedAt = $deletedAt;
  45. return $this;
  46. }
  47. public function getDeletedAt()
  48. {
  49. return $this->deletedAt;
  50. }
  51. public function setOwner(Person $owner)
  52. {
  53. $this->owner = $owner;
  54. return $this;
  55. }
  56. public function getOwner()
  57. {
  58. return $this->owner;
  59. }
  60. }