| 1 | <?php |
||
| 12 | class IdCollector extends Collector |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | protected $idKey; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var PreAggregate[] |
||
| 21 | */ |
||
| 22 | protected $idEntries; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param array $groupKeys |
||
| 26 | * @param string $idKey |
||
| 27 | */ |
||
| 28 | public function __construct(array $groupKeys, $idKey) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | public function getIdKey() |
||
| 42 | |||
| 43 | /** |
||
| 44 | * :TODO: maybe countKey instead of $inc |
||
| 45 | * |
||
| 46 | * @param mixed $entry |
||
| 47 | * @param int $inc |
||
| 48 | */ |
||
| 49 | public function addEntry($entry, $inc = 1) |
||
| 57 | |||
| 58 | /** |
||
| 59 | * :TODO: rename |
||
| 60 | * |
||
| 61 | * @return PreAggregate[] |
||
| 62 | */ |
||
| 63 | public function getIds() |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @param string $id |
||
| 70 | * |
||
| 71 | * @return PreAggregate |
||
| 72 | */ |
||
| 73 | public function getById($id) |
||
| 77 | } |