|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace AbterPhp\Website\Orm; |
|
6
|
|
|
|
|
7
|
|
|
use AbterPhp\Framework\Orm\IGridRepo; |
|
8
|
|
|
use AbterPhp\Website\Domain\Entities\ContentList as Entity; |
|
9
|
|
|
use AbterPhp\Website\Orm\DataMappers\ContentListSqlDataMapper as DataMapper; // @phan-suppress-current-line PhanUnreferencedUseNormal |
|
10
|
|
|
use Opulence\Orm\Repositories\Repository; |
|
11
|
|
|
|
|
12
|
|
|
class ContentListRepo extends Repository implements IGridRepo |
|
13
|
|
|
{ |
|
14
|
|
|
/** |
|
15
|
|
|
* @param int $limitFrom |
|
16
|
|
|
* @param int $pageSize |
|
17
|
|
|
* @param string[] $orders |
|
18
|
|
|
* @param array $conditions |
|
19
|
|
|
* @param array $params |
|
20
|
|
|
* |
|
21
|
|
|
* @return Entity[] |
|
22
|
|
|
* @throws \Opulence\Orm\OrmException |
|
23
|
|
|
*/ |
|
24
|
|
|
public function getPage(int $limitFrom, int $pageSize, array $orders, array $conditions, array $params): array |
|
25
|
|
|
{ |
|
26
|
|
|
/** @see DataMapper::getPage() */ |
|
27
|
|
|
return $this->getFromDataMapper('getPage', [$limitFrom, $pageSize, $orders, $conditions, $params]); |
|
|
|
|
|
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @param string $identifier |
|
32
|
|
|
* |
|
33
|
|
|
* @return Entity|null |
|
34
|
|
|
* @throws \Opulence\Orm\OrmException |
|
35
|
|
|
*/ |
|
36
|
|
|
public function getByIdentifier(string $identifier): ?Entity |
|
37
|
|
|
{ |
|
38
|
|
|
/** @see DataMapper::getByIdentifier() */ |
|
39
|
|
|
return $this->getFromDataMapper('getByIdentifier', [$identifier]); |
|
|
|
|
|
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @param string[] $identifiers |
|
44
|
|
|
* |
|
45
|
|
|
* @return Entity[] |
|
46
|
|
|
* @throws \Opulence\Orm\OrmException |
|
47
|
|
|
*/ |
|
48
|
|
|
public function getByIdentifiers(array $identifiers): array |
|
49
|
|
|
{ |
|
50
|
|
|
/** @see DataMapper::getByIdentifiers() */ |
|
51
|
|
|
return $this->getFromDataMapper('getByIdentifiers', [$identifiers]); |
|
|
|
|
|
|
52
|
|
|
} |
|
53
|
|
|
} |
|
54
|
|
|
|