public getIdUrlMap ( array $ids ) : array | ||
$ids | array | An array of URL ids |
return | array | An array of URLs, with ids as keys |
public function getIdUrlMap(array $ids)
{
$map = array();
if (!empty($ids)) {
$q = $this->getConnection()->createSelectQuery();
$q->select('id', 'url')->from(self::URL_TABLE)->where($q->expr->in('id', $ids));
$statement = $q->prepare();
$statement->execute();
foreach ($statement->fetchAll(PDO::FETCH_ASSOC) as $row) {
$map[$row['id']] = $row['url'];
}
}
return $map;
}