1 | <?php |
||
16 | class AnalyticModel |
||
17 | { |
||
18 | protected $collection; |
||
19 | protected $route; |
||
20 | protected $aggregate; |
||
21 | protected $pipeline; |
||
22 | protected $schema; |
||
23 | protected $type; |
||
24 | protected $cacheTime; |
||
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 | * Mongodb Aggregates |
||
66 | * @return mixed |
||
67 | */ |
||
68 | public function getAggregate() |
||
72 | |||
73 | /** |
||
74 | * Set mongodb query |
||
75 | * @param mixed $aggregate object type for query data |
||
76 | * @return void |
||
77 | */ |
||
78 | public function setAggregate($aggregate) |
||
82 | |||
83 | /** |
||
84 | * @param mixed $pipeline Data array for query |
||
85 | * @return void |
||
86 | */ |
||
87 | public function setPipeline($pipeline) |
||
91 | |||
92 | /** |
||
93 | * Schema for response |
||
94 | * @return mixed |
||
95 | */ |
||
96 | public function getSchema() |
||
100 | |||
101 | /** |
||
102 | * Schema data |
||
103 | * @param mixed $schema object schema |
||
104 | * @return void |
||
105 | */ |
||
106 | public function setSchema($schema) |
||
110 | |||
111 | /** |
||
112 | * Type of response data |
||
113 | * @return mixed |
||
114 | */ |
||
115 | public function getType() |
||
119 | |||
120 | /** |
||
121 | * Type for representation |
||
122 | * @param mixed $type string view |
||
123 | * @return void |
||
124 | */ |
||
125 | public function setType($type) |
||
129 | |||
130 | /** |
||
131 | * Time for this route data to be cached |
||
132 | * @return mixed |
||
|
|||
133 | */ |
||
134 | public function getCacheTime() |
||
138 | |||
139 | /** |
||
140 | * Time for this route data to be cached |
||
141 | * @param integer $cacheTime seconds to be cached |
||
142 | * @return void |
||
143 | */ |
||
144 | public function setCacheTime($cacheTime) |
||
148 | |||
149 | |||
150 | |||
151 | /** |
||
152 | * Build a output Db Model aggregation pipeline array. |
||
153 | * |
||
154 | * @return array |
||
155 | */ |
||
156 | public function getPipeline() |
||
182 | |||
183 | /** |
||
184 | * Enabling to possibility to create dtae queries |
||
185 | * Will replace PARSE_DATE(date|format) |
||
186 | * sample: PARSE_DATE(-4 years|Y) -> new DateTime(-4 years)->format(Y) -> 2013 |
||
187 | * |
||
188 | * @param object $query Aggregation query |
||
189 | * @return object |
||
190 | */ |
||
191 | private function parseObjectDates($query) |
||
205 | } |
||
206 |
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.