| 1 | <?php |
||
| 15 | abstract class DBALObjectRepository implements Repository |
||
| 16 | { |
||
| 17 | 2 | public function getIterator(): \Traversable |
|
| 18 | { |
||
| 19 | 2 | return static::createResult($this->qb()); |
|
| 20 | } |
||
| 21 | |||
| 22 | 1 | public function count(): int |
|
| 23 | { |
||
| 24 | 1 | return \count(static::createResult($this->qb())); |
|
| 25 | } |
||
| 26 | |||
| 27 | abstract protected static function createObject(array $data): object; |
||
| 28 | |||
| 29 | abstract protected static function tableName(): string; |
||
| 30 | |||
| 31 | abstract protected function connection(): Connection; |
||
| 32 | |||
| 33 | 2 | final protected static function createResult(QueryBuilder $qb): Result |
|
| 34 | { |
||
| 42 | |||
| 43 | 2 | protected static function createDBALQueryBuilderResult(QueryBuilder $qb): DBALQueryBuilderResult |
|
| 47 | |||
| 48 | 2 | protected function qb(): QueryBuilder |
|
| 52 | } |
||
| 53 |