MCPcopy Create free account
hub / github.com/Rello/analytics / fetchAllByIds

Method fetchAllByIds

lib/UserMigration/AnalyticsMigrator.php:151–167  ·  view source on GitHub ↗

* @param list $ids * @return list > * @throws Exception */

(string $table, string $idColumn, array $ids)

Source from the content-addressed store, hash-verified

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

Callers 1

exportMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected