| Total Complexity | 7 |
| Total Lines | 74 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class QueryWrapper implements QueryWrapperInterface |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * ActiveQuery instance |
||
| 18 | * @var Query |
||
| 19 | */ |
||
| 20 | protected Query $query; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * QueryWrapper constructor |
||
| 24 | */ |
||
| 25 | public function __construct() |
||
| 26 | { |
||
| 27 | $this->query = new Query(); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @inheritDoc |
||
| 32 | */ |
||
| 33 | public function select(array $arSelect): QueryWrapperInterface |
||
| 34 | { |
||
| 35 | $this->query->select($arSelect); |
||
| 36 | |||
| 37 | return $this; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @inheritDoc |
||
| 42 | */ |
||
| 43 | public function from(array $mapFrom): QueryWrapperInterface |
||
| 44 | { |
||
| 45 | $this->query->from($mapFrom); |
||
| 46 | |||
| 47 | return $this; |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @inheritDoc |
||
| 52 | */ |
||
| 53 | public function join( |
||
| 54 | string $type, |
||
| 55 | array $mapTable, |
||
| 56 | string $condition, |
||
| 57 | array $extraJoinParams = [] |
||
| 58 | ): QueryWrapperInterface { |
||
| 59 | $this->query->join("{$type} join", $mapTable, $condition, $extraJoinParams); |
||
| 60 | |||
| 61 | return $this; |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @inheritDoc |
||
| 66 | * @param Connection|null $db DB connection instance |
||
| 67 | */ |
||
| 68 | public function all($db = null): array |
||
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @inheritDoc |
||
| 75 | */ |
||
| 76 | public function getRawSql(): string |
||
| 79 | } |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @inheritDoc |
||
| 83 | * @return Query |
||
| 84 | */ |
||
| 85 | public function getQuery(): Query |
||
| 88 | } |
||
| 89 | } |
||
| 90 |