1 | <?php |
||
12 | class Client { |
||
13 | /** |
||
14 | * @ODM\Id |
||
15 | * @JMS\Type("string") |
||
16 | */ |
||
17 | protected $id; |
||
18 | |||
19 | /** |
||
20 | * @ODM\Field(type="string") |
||
21 | * @JMS\Type("string") |
||
22 | */ |
||
23 | protected $firstName; |
||
24 | |||
25 | /** |
||
26 | * @ODM\String |
||
27 | * @JMS\Type("string") |
||
28 | */ |
||
29 | protected $lastName; |
||
30 | |||
31 | /** |
||
32 | * @ODM\ReferenceMany(targetDocument="Test\TestBundle\Document\Order", mappedBy="client") |
||
33 | */ |
||
34 | protected $orders; |
||
35 | |||
36 | 25 | public function __construct() |
|
40 | |||
41 | /** |
||
42 | * Get id |
||
43 | * |
||
44 | * @return id $id |
||
45 | */ |
||
46 | 4 | public function getId() |
|
50 | |||
51 | /** |
||
52 | * Set firstName |
||
53 | * |
||
54 | * @param string $firstName |
||
55 | * @return self |
||
56 | */ |
||
57 | 25 | public function setFirstName($firstName) |
|
62 | |||
63 | /** |
||
64 | * Get firstName |
||
65 | * |
||
66 | * @return string $firstName |
||
67 | */ |
||
68 | 1 | public function getFirstName() |
|
72 | |||
73 | /** |
||
74 | * Set lastName |
||
75 | * |
||
76 | * @param string $lastName |
||
77 | * @return self |
||
78 | */ |
||
79 | 25 | public function setLastName($lastName) |
|
84 | |||
85 | /** |
||
86 | * Get lastName |
||
87 | * |
||
88 | * @return string $lastName |
||
89 | */ |
||
90 | public function getLastName() |
||
94 | |||
95 | /** |
||
96 | * Add orders |
||
97 | * |
||
98 | * @param Test\TestBundle\Document\Order $orders |
||
99 | * |
||
100 | * @return $this |
||
101 | */ |
||
102 | public function addOrder(\Test\TestBundle\Document\Order $orders) |
||
108 | |||
109 | /** |
||
110 | * Remove orders |
||
111 | * |
||
112 | * @param Test\TestBundle\Document\Order $orders |
||
113 | */ |
||
114 | public function removeOrder(\Test\TestBundle\Document\Order $orders) |
||
119 | |||
120 | /** |
||
121 | * Get orders |
||
122 | * |
||
123 | * @return Doctrine\Common\Collections\Collection $orders |
||
124 | */ |
||
125 | public function getOrders() |
||
129 | } |
||
130 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: