| Conditions | 4 |
| Paths | 6 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function run($request) |
||
| 22 | { |
||
| 23 | $br = Director::is_cli() ? "\n" : '<br/>'; |
||
| 24 | |||
| 25 | //TODO: include order total calculation, once that gets written |
||
| 26 | //TODO: figure out how to make this run faster |
||
| 27 | //TODO: better memory managment...the destroy calls are not enough it appears. |
||
| 28 | |||
| 29 | if ($orders = Order::get()) { |
||
| 30 | echo $br . 'Writing all order items '; |
||
| 31 | foreach ($orders as $order) { |
||
| 32 | $order->calculate(); |
||
| 33 | $order->write(); |
||
| 34 | } |
||
| 35 | echo $br . 'done.' . $br; |
||
| 36 | } |
||
| 39 |