User.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace Sluggable\Fixture\Handler;
  3. use Gedmo\Mapping\Annotation as Gedmo;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity
  7. */
  8. class User
  9. {
  10. /**
  11. * @ORM\Id
  12. * @ORM\GeneratedValue
  13. * @ORM\Column(type="integer")
  14. */
  15. private $id;
  16. /**
  17. * @ORM\Column(length=64)
  18. */
  19. private $username;
  20. /**
  21. * @Gedmo\Slug(handlers={
  22. * @Gedmo\SlugHandler(class="Gedmo\Sluggable\Handler\RelativeSlugHandler", options={
  23. * @Gedmo\SlugHandlerOption(name="relationField", value="company"),
  24. * @Gedmo\SlugHandlerOption(name="relationSlugField", value="alias"),
  25. * @Gedmo\SlugHandlerOption(name="separator", value="/")
  26. * })
  27. * }, separator="-", updatable=true, fields={"username"})
  28. * @ORM\Column(length=64, unique=true)
  29. */
  30. private $slug;
  31. /**
  32. * @ORM\ManyToOne(targetEntity="Company")
  33. */
  34. private $company;
  35. public function setCompany(Company $company = null)
  36. {
  37. $this->company = $company;
  38. }
  39. public function getCompany()
  40. {
  41. return $this->company;
  42. }
  43. public function getId()
  44. {
  45. return $this->id;
  46. }
  47. public function setUsername($username)
  48. {
  49. $this->username = $username;
  50. }
  51. public function getUsername()
  52. {
  53. return $this->username;
  54. }
  55. public function getSlug()
  56. {
  57. return $this->slug;
  58. }
  59. }