1 | <?php |
||
10 | trait Toolkit |
||
11 | { |
||
12 | protected $app; |
||
13 | |||
14 | 38 | public function __construct(Application $app) |
|
18 | |||
19 | 1 | protected function create(string $space, array $data) : Entity |
|
23 | |||
24 | 38 | protected function dispatch(string $job, array $params = [], string $service = null) |
|
28 | |||
29 | 1 | protected function find(string $space, $params = []) : array |
|
33 | |||
34 | protected function findOne(string $space, $params = []) : ?Entity |
||
35 | { |
||
36 | return $this->getRepository($space)->findOne($params); |
||
37 | } |
||
38 | |||
39 | protected function findOrCreate(string $space, $params = []) : Entity |
||
40 | { |
||
41 | return $this->getRepository($space)->findOrCreate($params); |
||
42 | } |
||
43 | |||
44 | protected function findOrFail(string $space, $params = []) : Entity |
||
45 | { |
||
46 | return $this->getRepository($space)->findOrFail($params); |
||
47 | } |
||
48 | |||
49 | protected function fire(string $event, array $context) |
||
53 | |||
54 | 18 | protected function get(string $class) |
|
58 | |||
59 | 1 | protected function getDate() |
|
63 | |||
64 | protected function getMapper() |
||
65 | { |
||
66 | return $this->get(Mapper::class); |
||
67 | } |
||
68 | |||
69 | 1 | protected function getRepository($space) |
|
76 | |||
77 | protected function getQueue($tube) |
||
92 | |||
93 | protected function remove(string $space, array $params = []) |
||
94 | { |
||
95 | return $this->getRepository($space)->remove($params); |
||
96 | } |
||
97 | |||
98 | 2 | protected function select($fields, string $table, array $params) |
|
102 | |||
103 | 2 | protected function insert(string $table, array $data, array $headers) |
|
107 | |||
108 | public function __debugInfo() |
||
114 | } |
||
115 |