* @param list $ids * @return list > * @throws Exception */
(string $table, string $idColumn, array $ids)
| 138 | * @throws Exception |
| 139 | */ |
| 140 | private function fetchAllByIds(string $table, string $idColumn, array $ids): array { |
| 141 | if ($ids === []) { |
| 142 | return []; |
| 143 | } |
| 144 | |
| 145 | $sql = $this->db->getQueryBuilder(); |
| 146 | $sql->from($table) |
| 147 | ->select('*') |
| 148 | ->where($sql->expr()->in($idColumn, $sql->createParameter('ids'))) |
| 149 | ->setParameter('ids', $ids, IQueryBuilder::PARAM_INT_ARRAY); |
| 150 | |
| 151 | $statement = $sql->executeQuery(); |
| 152 | $result = $statement->fetchAll(); |
| 153 | $statement->closeCursor(); |
| 154 | |
| 155 | return is_array($result) ? $result : []; |
| 156 | } |
| 157 | |
| 158 | /** |
| 159 | * @param list<array<string,mixed>> $rows |