1 | <?php |
||
26 | class AggregationHelper |
||
27 | { |
||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | private $schema = []; |
||
32 | |||
33 | /** |
||
34 | * @var DocumentEntity |
||
35 | */ |
||
36 | protected $source; |
||
37 | |||
38 | /** |
||
39 | * @var ODMInterface |
||
40 | */ |
||
41 | protected $odm; |
||
42 | |||
43 | /** |
||
44 | * @param DocumentEntity $source |
||
45 | * @param ODMInterface $odm |
||
46 | */ |
||
47 | public function __construct(DocumentEntity $source, ODMInterface $odm) |
||
53 | |||
54 | /** |
||
55 | * Create aggregation (one or many) based on given source values. |
||
56 | * |
||
57 | * @param string $aggregation |
||
58 | * |
||
59 | * @return DocumentSelector|CompositableInterface |
||
60 | */ |
||
61 | public function createAggregation(string $aggregation) |
||
77 | |||
78 | /** |
||
79 | * Configure DocumentSelector using aggregation schema. |
||
80 | * |
||
81 | * @param DocumentSelector $selector |
||
82 | * @param array $aggregation |
||
83 | * |
||
84 | * @return DocumentSelector |
||
85 | */ |
||
86 | protected function configureSelector( |
||
102 | |||
103 | /** |
||
104 | * Find field value using dot notation. |
||
105 | * |
||
106 | * @param string $name |
||
107 | * |
||
108 | * @return mixed|null |
||
109 | */ |
||
110 | private function findValue(string $name) |
||
142 | } |