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() |
||
82 | |||
83 | /** |
||
84 | * Schema data |
||
85 | * @param mixed $schema object schema |
||
86 | * @return void |
||
87 | */ |
||
88 | public function setSchema($schema) |
||
92 | |||
93 | /** |
||
94 | * Type of response data |
||
95 | * @return mixed |
||
96 | */ |
||
97 | public function getType() |
||
101 | |||
102 | /** |
||
103 | * Type for representation |
||
104 | * @param mixed $type string view |
||
105 | * @return void |
||
106 | */ |
||
107 | public function setType($type) |
||
111 | |||
112 | /** |
||
113 | * Time for this route data to be cached |
||
114 | * @return mixed |
||
|
|||
115 | */ |
||
116 | public function getCacheTime() |
||
120 | |||
121 | /** |
||
122 | * Time for this route data to be cached |
||
123 | * @param integer $cacheTime seconds to be cached |
||
124 | * @return void |
||
125 | */ |
||
126 | public function setCacheTime($cacheTime) |
||
130 | |||
131 | /** |
||
132 | * Build a output Db Model aggregation pipeline array. |
||
133 | * |
||
134 | * @return array |
||
135 | */ |
||
136 | public function getAggregate($params = []) |
||
156 | |||
157 | /** |
||
158 | * get Params |
||
159 | * |
||
160 | * @return mixed Params |
||
161 | */ |
||
162 | public function getParams() |
||
166 | |||
167 | /** |
||
168 | * set Params |
||
169 | * |
||
170 | * @param mixed $params params |
||
171 | * |
||
172 | * @return void |
||
173 | */ |
||
174 | public function setParams($params) |
||
178 | |||
179 | /** |
||
180 | * Enabling to possibility to create dtae queries |
||
181 | * Will replace PARSE_DATE(date|format) |
||
182 | * sample: PARSE_DATE(-4 years|Y) -> new DateTime(-4 years)->format(Y) -> 2013 |
||
183 | * |
||
184 | * @param object $query Aggregation query |
||
185 | * @return object |
||
186 | */ |
||
187 | private function parseObjectDates($query) |
||
201 | |||
202 | private function getParameterizedAggregate($params) |
||
223 | } |
||
224 |
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.