* @param list $ids * @return list > * @throws Exception */
(string $table, string $idColumn, array $ids)
| 149 | * @throws Exception |
| 150 | */ |
| 151 | private function fetchAllByIds(string $table, string $idColumn, array $ids): array { |
| 152 | if ($ids === []) { |
| 153 | return []; |
| 154 | } |
| 155 | |
| 156 | $sql = $this->db->getQueryBuilder(); |
| 157 | $sql->from($table) |
| 158 | ->select('*') |
| 159 | ->where($sql->expr()->in($idColumn, $sql->createParameter('ids'))) |
| 160 | ->setParameter('ids', $ids, IQueryBuilder::PARAM_INT_ARRAY); |
| 161 | |
| 162 | $statement = $sql->executeQuery(); |
| 163 | $result = $statement->fetchAll(); |
| 164 | $statement->closeCursor(); |
| 165 | |
| 166 | return is_array($result) ? $result : []; |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * @param list<array<string,mixed>> $rows |