1 | <?php |
||
18 | class AnalyticsManager |
||
19 | { |
||
20 | /** @var DocumentManager */ |
||
21 | protected $documentManager; |
||
22 | |||
23 | /** |
||
24 | * AnalyticsManager constructor. |
||
25 | * @param DocumentManager $documentManager Db manager and query control |
||
26 | */ |
||
27 | public function __construct(DocumentManager $documentManager) |
||
31 | |||
32 | /** |
||
33 | * Query db based on definition |
||
34 | * Another option is to use: $collection->createAggregationBuilder(); |
||
35 | * |
||
36 | * @param AnalyticModel $schema Definition |
||
37 | * @return array|object |
||
38 | */ |
||
39 | public function getData(AnalyticModel $schema) |
||
59 | |||
60 | /** |
||
61 | * Enabling to possibility to create dtae queries |
||
62 | * Will replace PARSE_DATE(date|format) |
||
63 | * sample: PARSE_DATE(-4 years|Y) -> new DateTime(-4 years)->format(Y) -> 2013 |
||
64 | * |
||
65 | * @param object $query Aggregation query |
||
66 | * @return object |
||
67 | */ |
||
68 | private function parseObjectDates($query) |
||
82 | } |
||
83 |