AbstractClosure.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. namespace Gedmo\Tree\Entity;
  3. use Doctrine\ORM\Mapping\Column;
  4. use Doctrine\ORM\Mapping\MappedSuperclass;
  5. use Doctrine\ORM\Mapping\Id;
  6. use Doctrine\ORM\Mapping\GeneratedValue;
  7. /**
  8. * @MappedSuperclass
  9. */
  10. abstract class AbstractClosure
  11. {
  12. /**
  13. * @Id
  14. * @GeneratedValue
  15. * @Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * Mapped by listener
  20. * Visibility must be protected
  21. */
  22. protected $ancestor;
  23. /**
  24. * Mapped by listener
  25. * Visibility must be protected
  26. */
  27. protected $descendant;
  28. /**
  29. * @Column(type="integer")
  30. */
  31. private $depth;
  32. /**
  33. * Get id
  34. *
  35. * @return integer
  36. */
  37. public function getId()
  38. {
  39. return $this->id;
  40. }
  41. /**
  42. * Set ancestor
  43. *
  44. * @param object $ancestor
  45. * @return AbstractClosure
  46. */
  47. public function setAncestor($ancestor)
  48. {
  49. $this->ancestor = $ancestor;
  50. return $this;
  51. }
  52. /**
  53. * Get ancestor
  54. *
  55. * @return object
  56. */
  57. public function getAncestor()
  58. {
  59. return $this->ancestor;
  60. }
  61. /**
  62. * Set descendant
  63. *
  64. * @param object $descendant
  65. * @return AbstractClosure
  66. */
  67. public function setDescendant($descendant)
  68. {
  69. $this->descendant = $descendant;
  70. return $this;
  71. }
  72. /**
  73. * Get descendant
  74. *
  75. * @return object
  76. */
  77. public function getDescendant()
  78. {
  79. return $this->descendant;
  80. }
  81. /**
  82. * Set depth
  83. *
  84. * @param integer $depth
  85. * @return AbstractClosure
  86. */
  87. public function setDepth($depth)
  88. {
  89. $this->depth = $depth;
  90. return $this;
  91. }
  92. /**
  93. * Get depth
  94. *
  95. * @return integer
  96. */
  97. public function getDepth()
  98. {
  99. return $this->depth;
  100. }
  101. }