2011-07-28 12:46:38 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\Models\Legacy;
|
|
|
|
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
* @Table(name="legacy_cars")
|
|
|
|
*/
|
|
|
|
class LegacyCar
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @Id
|
|
|
|
* @GeneratedValue
|
|
|
|
* @Column(name="iCarId", type="integer", nullable=false)
|
|
|
|
*/
|
2011-07-28 14:25:23 +04:00
|
|
|
public $_id;
|
2011-07-28 12:46:38 +04:00
|
|
|
/**
|
2011-07-28 14:25:23 +04:00
|
|
|
* @ManyToMany(targetEntity="LegacyUser", mappedBy="_cars")
|
2011-07-28 12:46:38 +04:00
|
|
|
*/
|
2011-07-28 14:25:23 +04:00
|
|
|
public $_users;
|
2011-07-28 12:46:38 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @Column(name="sDescription", type="string", length=255, unique=true)
|
|
|
|
*/
|
2011-07-28 14:25:23 +04:00
|
|
|
public $_description;
|
2011-07-28 12:46:38 +04:00
|
|
|
|
|
|
|
function getDescription()
|
|
|
|
{
|
2011-07-28 14:25:23 +04:00
|
|
|
return $this->_description;
|
2011-07-28 12:46:38 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function addUser(LegacyUser $user) {
|
2011-07-28 14:25:23 +04:00
|
|
|
$this->_users[] = $user;
|
2011-07-28 12:46:38 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getUsers() {
|
2011-07-28 14:25:23 +04:00
|
|
|
return $this->_users;
|
2011-07-28 12:46:38 +04:00
|
|
|
}
|
|
|
|
}
|