ANode.php 936 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace Tree\Fixture;
  3. use Gedmo\Mapping\Annotation as Gedmo;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\MappedSuperclass
  7. */
  8. class ANode
  9. {
  10. /**
  11. * @ORM\Id
  12. * @ORM\GeneratedValue
  13. * @ORM\Column(type="integer")
  14. */
  15. private $id;
  16. /**
  17. * @Gedmo\TreeLeft
  18. * @ORM\Column(type="integer", nullable=true)
  19. */
  20. private $lft;
  21. /**
  22. * @Gedmo\TreeRight
  23. * @ORM\Column(type="integer", nullable=true)
  24. */
  25. private $rgt;
  26. /**
  27. * @Gedmo\TreeParent
  28. * @ORM\ManyToOne(targetEntity="BaseNode", inversedBy="children")
  29. * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE")
  30. */
  31. private $parent;
  32. public function getId()
  33. {
  34. return $this->id;
  35. }
  36. public function setParent($parent = null)
  37. {
  38. $this->parent = $parent;
  39. }
  40. public function getParent()
  41. {
  42. return $this->parent;
  43. }
  44. }