Item.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace Sortable\Fixture;
  3. use Gedmo\Mapping\Annotation as Gedmo;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity(repositoryClass="Gedmo\Sortable\Entity\Repository\SortableRepository")
  7. */
  8. class Item
  9. {
  10. /**
  11. * @ORM\Id
  12. * @ORM\GeneratedValue
  13. * @ORM\Column(type="integer")
  14. */
  15. private $id;
  16. /**
  17. * @ORM\Column(type="string", length=255)
  18. */
  19. private $name;
  20. /**
  21. * @Gedmo\SortablePosition
  22. * @ORM\Column(type="integer")
  23. */
  24. private $position;
  25. /**
  26. * @Gedmo\SortableGroup
  27. * @ORM\ManyToOne(targetEntity="Category", inversedBy="items")
  28. */
  29. private $category;
  30. public function getId()
  31. {
  32. return $this->id;
  33. }
  34. public function setName($name)
  35. {
  36. $this->name = $name;
  37. }
  38. public function getName()
  39. {
  40. return $this->name;
  41. }
  42. public function setPosition($position)
  43. {
  44. $this->position = $position;
  45. }
  46. public function getPosition()
  47. {
  48. return $this->position;
  49. }
  50. public function setCategory(Category $category = null)
  51. {
  52. $this->category = $category;
  53. }
  54. public function getCategory()
  55. {
  56. return $this->category;
  57. }
  58. }