BehavioralCategory.php 1.5 KB

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