AbstractClosure.php 1.6 KB

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