AbstractClosure.php 1.7 KB

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