1 | <?php |
||
16 | class AnalyticModel |
||
17 | { |
||
18 | protected $collection; |
||
19 | protected $route; |
||
20 | protected $aggregate = []; |
||
21 | protected $schema; |
||
22 | protected $type; |
||
23 | protected $cacheTime; |
||
24 | protected $params = []; |
||
25 | |||
26 | /** |
||
27 | * String collection |
||
28 | * @return mixed |
||
29 | */ |
||
30 | public function getCollection() |
||
34 | |||
35 | /** |
||
36 | * Set value of collection |
||
37 | * @param mixed $collection string name |
||
38 | * @return void |
||
39 | */ |
||
40 | public function setCollection($collection) |
||
44 | |||
45 | /** |
||
46 | * Route path |
||
47 | * @return mixed |
||
48 | */ |
||
49 | public function getRoute() |
||
53 | |||
54 | /** |
||
55 | * Set path |
||
56 | * @param mixed $route string route |
||
57 | * @return void |
||
58 | */ |
||
59 | public function setRoute($route) |
||
63 | |||
64 | /** |
||
65 | * Set mongodb query |
||
66 | * @param mixed $aggregate object type for query data |
||
67 | * @return void |
||
68 | */ |
||
69 | public function setAggregate($aggregate) |
||
73 | |||
74 | /** |
||
75 | * Schema for response |
||
76 | * @return mixed |
||
77 | */ |
||
78 | public function getSchema() |
||
84 | |||
85 | /** |
||
86 | * Schema data |
||
87 | * @param mixed $schema object schema |
||
88 | * @return void |
||
89 | */ |
||
90 | public function setSchema($schema) |
||
94 | |||
95 | /** |
||
96 | * Type of response data |
||
97 | * @return mixed |
||
98 | */ |
||
99 | public function getType() |
||
103 | |||
104 | /** |
||
105 | * Type (array or object) |
||
106 | * @param mixed $type string view |
||
107 | * @return void |
||
108 | */ |
||
109 | public function setType($type) |
||
113 | |||
114 | /** |
||
115 | * Time for this route data to be cached |
||
116 | * @return mixed |
||
|
|||
117 | */ |
||
118 | public function getCacheTime() |
||
122 | |||
123 | /** |
||
124 | * Time for this route data to be cached |
||
125 | * @param integer $cacheTime seconds to be cached |
||
126 | * @return void |
||
127 | */ |
||
128 | public function setCacheTime($cacheTime) |
||
132 | |||
133 | /** |
||
134 | * Build a output Db Model aggregation pipeline array. |
||
135 | * |
||
136 | * @param array $params params |
||
137 | * |
||
138 | * @return array the pipeline |
||
139 | */ |
||
140 | public function getAggregate($params = []) |
||
150 | |||
151 | /** |
||
152 | * get Params |
||
153 | * |
||
154 | * @return mixed Params |
||
155 | */ |
||
156 | public function getParams() |
||
160 | |||
161 | /** |
||
162 | * set Params |
||
163 | * |
||
164 | * @param mixed $params params |
||
165 | * |
||
166 | * @return void |
||
167 | */ |
||
168 | public function setParams($params) |
||
172 | |||
173 | /** |
||
174 | * returns the pipeline with param values replaced |
||
175 | * |
||
176 | * @param array $params the params |
||
177 | * |
||
178 | * @return array the pipeline with values filled in |
||
179 | */ |
||
180 | private function getParameterizedAggregate(array $params) |
||
202 | |||
203 | /** |
||
204 | * parse object structures that need to be injected in order to execute the query (like MongoDates or Ids) |
||
205 | * |
||
206 | * @param array $struct the pipeline |
||
207 | * |
||
208 | * @return array changed pipeline |
||
209 | */ |
||
210 | private function parseObjectInstances(array $struct) |
||
222 | } |
||
223 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.