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

Method fetchAllByIds

lib/UserMigration/AnalyticsMigrator.php:140–156  ·  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

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

Callers 1

exportMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected