| 1 | <?php |
||
| 12 | final class AggregationDefinition |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * Aggregation type, see Document::ONE and Document::MANY. |
||
| 16 | * |
||
| 17 | * @var int |
||
| 18 | */ |
||
| 19 | private $type; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Linked class. |
||
| 23 | * |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | private $class; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Query template. |
||
| 30 | * |
||
| 31 | * @var array |
||
| 32 | */ |
||
| 33 | private $query = []; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param int $type |
||
| 37 | * @param string $class |
||
| 38 | * @param array $query |
||
| 39 | */ |
||
| 40 | public function __construct(int $type, string $class, array $query) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Aggregation type, see Document::ONE and Document::MANY. |
||
| 49 | * |
||
| 50 | * @return int |
||
| 51 | */ |
||
| 52 | public function getType(): int |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Linked class. |
||
| 59 | * |
||
| 60 | * @return string |
||
| 61 | */ |
||
| 62 | public function getClass(): string |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Query template. |
||
| 69 | * |
||
| 70 | * @return array |
||
| 71 | */ |
||
| 72 | public function getQuery(): array |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @return array |
||
| 79 | */ |
||
| 80 | public function packSchema(): array |
||
| 84 | } |