1 | <?php |
||
23 | class BillMe extends Queries |
||
24 | { |
||
25 | |||
26 | |||
27 | |||
28 | /** |
||
29 | * A function that triggers order creation |
||
30 | * |
||
31 | */ |
||
32 | public function createOrder( |
||
84 | |||
85 | |||
86 | |||
87 | public function add_billing_record(Order $order, Invoice $invoice) |
||
101 | |||
102 | |||
103 | /** |
||
104 | * Function that triggers sending of email notification for orders |
||
105 | */ |
||
106 | |||
107 | public function sendMailNotifications(Order $order, Invoice $invoice) |
||
113 | |||
114 | |||
115 | |||
116 | /** |
||
117 | * Function that creates an invoie from an order |
||
118 | */ |
||
119 | |||
120 | public function createInvoice(Order $order): Invoice |
||
142 | |||
143 | |||
144 | /** |
||
145 | * Function that gets you invoice details by using orderid |
||
146 | */ |
||
147 | |||
148 | public function getInvoiceByOrderId($orderid) |
||
152 | |||
153 | /** |
||
154 | * Function that gets you invoice details by using invoiceid |
||
155 | */ |
||
156 | |||
157 | public function getInvoiceByInvoiceId($invoiceid) |
||
162 | |||
163 | |||
164 | |||
165 | /** |
||
166 | * Function that gets you order details by using orderid |
||
167 | */ |
||
168 | |||
169 | public function getOrderByOrderId($orderid) |
||
173 | |||
174 | /** |
||
175 | * Function that gets you order details by using invoiceid |
||
176 | */ |
||
177 | |||
178 | public function getOrderByInvoiceId($invoiceid) |
||
182 | |||
183 | |||
184 | /** |
||
185 | * Function that updates invoice status and returns void |
||
186 | */ |
||
187 | public function update_invoice_status(string $invoiceid, string $status): void |
||
193 | |||
194 | |||
195 | public function update_invoice(string $invoiceid, Invoice $invoice): void |
||
198 | |||
199 | |||
200 | |||
201 | |||
202 | /** |
||
203 | * Function that updates order status and returns void |
||
204 | */ |
||
205 | public function update_order_status(string $orderid, string $status): void |
||
211 | |||
212 | |||
213 | /** |
||
214 | * Function that updates an order returns void |
||
215 | */ |
||
216 | public function update_order(string $order_id, Order $order): void |
||
219 | |||
220 | |||
221 | /** |
||
222 | * Function that updates and status to cancelled returns void |
||
223 | */ |
||
224 | public function cancel_order(string $orderid): void |
||
230 | |||
231 | |||
232 | /** |
||
233 | * Function that deletes an order returns void |
||
234 | */ |
||
235 | public function delete_order(string $orderid) |
||
242 | |||
243 | /** |
||
244 | * Function that deletes an invoice returns void |
||
245 | */ |
||
246 | public function delete_invoice(string $orderid): void |
||
251 | } |
||
252 |
If the size of the collection does not change during the iteration, it is generally a good practice to compute it beforehand, and not on each iteration: