1 | <?php |
||
15 | class CarOwner { |
||
16 | /** |
||
17 | * @ORM\Id |
||
18 | * @ORM\Column(type="integer") |
||
19 | * @ORM\GeneratedValue(strategy="AUTO") |
||
20 | * @JMS\Type("integer") |
||
21 | */ |
||
22 | protected $id; |
||
23 | |||
24 | /** |
||
25 | * @ORM\Column(type="string") |
||
26 | * @JMS\Type("string") |
||
27 | */ |
||
28 | protected $name; |
||
29 | |||
30 | /** |
||
31 | * @ORM\OneToMany(targetEntity="Test\TestBundle\Entity\Car", mappedBy="carOwner") |
||
32 | * @JMS\Type("ArrayCollection<Test\TestBundle\Entity\Car>") |
||
33 | */ |
||
34 | protected $cars; |
||
35 | |||
36 | /** |
||
37 | * Constructor |
||
38 | */ |
||
39 | 10 | public function __construct() |
|
43 | |||
44 | /** |
||
45 | * Get id |
||
46 | * |
||
47 | * @return integer |
||
48 | */ |
||
49 | 5 | public function getId() |
|
53 | |||
54 | /** |
||
55 | * Set name |
||
56 | * |
||
57 | * @param string $name |
||
58 | * @return CarOwner |
||
59 | */ |
||
60 | 10 | public function setName($name) |
|
66 | |||
67 | /** |
||
68 | * Get name |
||
69 | * |
||
70 | * @return string |
||
71 | */ |
||
72 | 1 | public function getName() |
|
76 | |||
77 | /** |
||
78 | * Add cars |
||
79 | * |
||
80 | * @param Car $cars |
||
81 | * @return CarOwner |
||
82 | */ |
||
83 | 10 | public function addCar(Car $cars) |
|
89 | |||
90 | /** |
||
91 | * Remove cars |
||
92 | * |
||
93 | * @param Car $cars |
||
94 | */ |
||
95 | public function removeCar(Car $cars) |
||
100 | |||
101 | /** |
||
102 | * Get cars |
||
103 | * |
||
104 | * @return \Doctrine\Common\Collections\Collection |
||
105 | */ |
||
106 | public function getCars() |
||
110 | } |