/**
* Returns the list of websites from the ID array in parameters.
* The user access is not checked in this method so the ID have to be accessible by the user!
*
* @param array $idSites list of website ID
* @param bool $limit
* @return array
*/
private function getSitesFromIds($idSites, $limit = false)
{
if (count($idSites) === 0) {
return array();
}
if ($limit) {
$limit = "LIMIT " . (int) $limit;
}
$db = Db::get();
$sites = $db->fetchAll("SELECT *\n\t\t\t\t\t\t\t\tFROM " . Common::prefixTable("site") . "\n\t\t\t\t\t\t\t\tWHERE idsite IN (" . implode(", ", $idSites) . ")\n\t\t\t\t\t\t\t\tORDER BY idsite ASC {$limit}");
Site::setSitesFromArray($sites);
return $sites;
}