LegacyCar.php 752B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace Doctrine\Tests\Models\Legacy;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. /**
  5. * @Entity
  6. * @Table(name="legacy_cars")
  7. */
  8. class LegacyCar
  9. {
  10. /**
  11. * @Id
  12. * @GeneratedValue
  13. * @Column(name="iCarId", type="integer", nullable=false)
  14. */
  15. public $_id;
  16. /**
  17. * @ManyToMany(targetEntity="LegacyUser", mappedBy="_cars")
  18. */
  19. public $_users;
  20. /**
  21. * @Column(name="sDescription", type="string", length=255, unique=true)
  22. */
  23. public $_description;
  24. function getDescription()
  25. {
  26. return $this->_description;
  27. }
  28. public function addUser(LegacyUser $user) {
  29. $this->_users[] = $user;
  30. }
  31. public function getUsers() {
  32. return $this->_users;
  33. }
  34. }