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