1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10:
11:
12: namespace App\Modules\StoreModule\Presenters;
13:
14: use App\Presenters\RenderPresenter,
15: App\Modules\StoreModule\Model\Move;
16:
17: class MovePresenter extends RenderPresenter {
18:
19:
20: private $move;
21:
22:
23: private $ready;
24:
25: public function __construct(Move $move) {
26: $this->move = $move;
27: parent::__construct();
28: }
29:
30: 31: 32: 33: 34:
35: protected function beforeProcess($values) {
36: $this->ready = $this->move->prepareMove($values);
37: return $values;
38: }
39:
40: 41: 42: 43:
44: protected function afterProcess($id) {
45: if (is_int($id) && $this->ready === TRUE) {
46: $this->move->processMove($id);
47: }
48: }
49: }
50: