CmsGroup.php 807B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /*
  3. * To change this template, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. namespace Doctrine\Tests\Models\CMS;
  7. /**
  8. * Description of CmsGroup
  9. *
  10. * @author robo
  11. * @Entity
  12. * @Table(name="cms_groups")
  13. */
  14. class CmsGroup
  15. {
  16. /**
  17. * @Id
  18. * @Column(type="integer")
  19. * @GeneratedValue
  20. */
  21. public $id;
  22. /**
  23. * @Column(length=50)
  24. */
  25. public $name;
  26. /**
  27. * @ManyToMany(targetEntity="CmsUser", mappedBy="groups")
  28. */
  29. public $users;
  30. public function setName($name) {
  31. $this->name = $name;
  32. }
  33. public function getName() {
  34. return $this->name;
  35. }
  36. public function addUser(CmsUser $user) {
  37. $this->users[] = $user;
  38. }
  39. public function getUsers() {
  40. return $this->users;
  41. }
  42. }