1 | <?php |
||
16 | class Order { |
||
17 | /** |
||
18 | * @ODM\Id |
||
19 | * @JMS\Type("string") |
||
20 | */ |
||
21 | protected $id; |
||
22 | |||
23 | /** |
||
24 | * @ODM\Field(type="string") |
||
25 | * @JMS\Type("string") |
||
26 | * @Assert\NotNull |
||
27 | */ |
||
28 | protected $name; |
||
29 | |||
30 | /** |
||
31 | * @ODM\EmbedMany(targetDocument="Test\TestBundle\Document\OrderLineItem") |
||
32 | * @JMS\Type("ArrayCollection<Test\TestBundle\Document\OrderLineItem>") |
||
33 | */ |
||
34 | protected $lineItems; |
||
35 | |||
36 | /** |
||
37 | * @ODM\EmbedOne(targetDocument="Test\TestBundle\Document\OrderLineItem") |
||
38 | * @JMS\Type("Test\TestBundle\Document\OrderLineItem") |
||
39 | */ |
||
40 | protected $lastLineItem; |
||
41 | |||
42 | /** |
||
43 | * @ODM\ReferenceOne(targetDocument="Test\TestBundle\Document\Client", inversedBy="orders", cascade={"persist"}) |
||
44 | * @JMS\Type("Test\TestBundle\Document\Client") |
||
45 | */ |
||
46 | protected $client; |
||
47 | |||
48 | /** |
||
49 | * @ODM\Float |
||
50 | * @JMS\Type("float") |
||
51 | * @Assert\NotNull(groups={"post"}) |
||
52 | */ |
||
53 | protected $totalPrice; |
||
54 | |||
55 | 25 | public function __construct() |
|
59 | |||
60 | /** |
||
61 | * Get id |
||
62 | * |
||
63 | * @return id $id |
||
64 | */ |
||
65 | 16 | public function getId() |
|
69 | |||
70 | 6 | public function setId($id) { |
|
74 | |||
75 | /** |
||
76 | * Set name |
||
77 | * |
||
78 | * @param string $name |
||
79 | * @return self |
||
80 | */ |
||
81 | 25 | public function setName($name) |
|
86 | |||
87 | /** |
||
88 | * Get name |
||
89 | * |
||
90 | * @return string $name |
||
91 | */ |
||
92 | 6 | public function getName() |
|
96 | |||
97 | /** |
||
98 | * Add lineItems |
||
99 | * |
||
100 | * @param OrderLineItem $lineItems |
||
101 | * |
||
102 | * @return $this |
||
103 | */ |
||
104 | 25 | public function addLineItem(OrderLineItem $lineItems) |
|
109 | |||
110 | /** |
||
111 | * Remove lineItems |
||
112 | * |
||
113 | * @param OrderLineItem $lineItems |
||
114 | */ |
||
115 | public function removeLineItem(OrderLineItem $lineItems) |
||
119 | |||
120 | /** |
||
121 | * Get lineItems |
||
122 | * |
||
123 | * @return ArrayCollection $lineItems |
||
124 | */ |
||
125 | 7 | public function getLineItems() |
|
129 | |||
130 | /** |
||
131 | * Set totalPrice |
||
132 | * |
||
133 | * @param float $totalPrice |
||
134 | * @return self |
||
135 | */ |
||
136 | 25 | public function setTotalPrice($totalPrice) |
|
141 | |||
142 | /** |
||
143 | * Get totalPrice |
||
144 | * |
||
145 | * @return float $totalPrice |
||
146 | */ |
||
147 | 5 | public function getTotalPrice() |
|
151 | |||
152 | /** |
||
153 | * Set lastLineItem |
||
154 | * |
||
155 | * @param Test\TestBundle\Document\OrderLineItem $lastLineItem |
||
156 | * @return self |
||
157 | */ |
||
158 | public function setLastLineItem(\Test\TestBundle\Document\OrderLineItem $lastLineItem) |
||
163 | |||
164 | /** |
||
165 | * Get lastLineItem |
||
166 | * |
||
167 | * @return Test\TestBundle\Document\OrderLineItem $lastLineItem |
||
168 | */ |
||
169 | public function getLastLineItem() |
||
173 | |||
174 | /** |
||
175 | * Set client |
||
176 | * |
||
177 | * @param Test\TestBundle\Document\Client $client |
||
178 | * @return self |
||
179 | */ |
||
180 | 25 | public function setClient(\Test\TestBundle\Document\Client $client) |
|
185 | |||
186 | /** |
||
187 | * Get client |
||
188 | * |
||
189 | * @return Test\TestBundle\Document\Client $client |
||
190 | */ |
||
191 | 6 | public function getClient() |
|
195 | |||
196 | public function mergeLineItems(ArrayCollection $list) { |
||
210 | } |
||
211 |