$podcasts[$i] = new Podcast($bdd_drupal, $elem, $date); } } } for ($i = $second; $i != 24; $i++) { if (!isset($podcasts[$i])) { $entries = get_paulo_entries($date, $i, $bdd_paulo, ".."); if ($entries && count($entries) > 0) { $podcasts[$i] = new Podcast($bdd_drupal, $i, $entries, 1, $date); } } } // on modifie les écoutes, et on ajoute les titres pour les 100% foreach ($podcasts as $p) { $p->setEcoutes($ecoutes); if ($p->is100p100()) { $entries = get_paulo_entries($date, $p->time, $bdd_paulo, ".."); $p->set_paulo_entries($entries); } } // retour switch ($data->getMethod()) { case 'get': RestUtils::sendResponse(200, json_encode($podcasts, JSON_HEX_APOS), 'application/json'); break; case 'post': RestUtils::sendResponse(200, json_encode($podcasts, JSON_HEX_APOS), 'application/json'); break; default: break; }
function charger_titres($timecode) { $elems = explode(' ', $timecode); $hour = intval($elems[1]); $date = $elems[0]; $duration = 1; global $bdd; return get_paulo_entries($date, $hour, $bdd, "../podcast/player/"); }