BehavioralCategory.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. namespace Tree\Fixture;
  3. /**
  4. * @Entity(repositoryClass="Tree\Fixture\Repository\BehavioralCategoryRepository")
  5. * @gedmo:Tree(type="nested")
  6. */
  7. class BehavioralCategory
  8. {
  9. /**
  10. * @Column(name="id", type="integer")
  11. * @Id
  12. * @GeneratedValue
  13. */
  14. private $id;
  15. /**
  16. * @gedmo:Translatable
  17. * @gedmo:Sluggable
  18. * @Column(name="title", type="string", length=64)
  19. */
  20. private $title;
  21. /**
  22. * @gedmo:TreeLeft
  23. * @Column(name="lft", type="integer", nullable=true)
  24. */
  25. private $lft;
  26. /**
  27. * @gedmo:TreeRight
  28. * @Column(name="rgt", type="integer", nullable=true)
  29. */
  30. private $rgt;
  31. /**
  32. * @gedmo:TreeParent
  33. * @ManyToOne(targetEntity="BehavioralCategory", inversedBy="children")
  34. */
  35. private $parent;
  36. /**
  37. * @OneToMany(targetEntity="BehavioralCategory", mappedBy="parent")
  38. */
  39. private $children;
  40. /**
  41. * @gedmo:Translatable
  42. * @gedmo:Slug
  43. * @Column(name="slug", type="string", length=128, unique=true)
  44. */
  45. private $slug;
  46. public function getId()
  47. {
  48. return $this->id;
  49. }
  50. public function getSlug()
  51. {
  52. return $this->slug;
  53. }
  54. public function setTitle($title)
  55. {
  56. $this->title = $title;
  57. }
  58. public function getTitle()
  59. {
  60. return $this->title;
  61. }
  62. public function setParent(BehavioralCategory $parent)
  63. {
  64. $this->parent = $parent;
  65. }
  66. public function getParent()
  67. {
  68. return $this->parent;
  69. }
  70. }