SweTv::getPrograms PHP Méthode

getPrograms() public méthode

public getPrograms ( $channelId )
    public function getPrograms($channelId)
    {
        $nu = strtotime(date('Y-m-d', time() + 86400));
        $sth = $this->db->prepare('SELECT * FROM tv_program WHERE kanalid = ? AND datum < ? ORDER BY datum DESC');
        $sth->bindParam(1, $channelId, PDO::PARAM_INT);
        $sth->bindParam(2, $nu, PDO::PARAM_INT);
        $sth->execute();
        return $sth->fetchAll(PDO::FETCH_ASSOC);
    }

Usage Example

Exemple #1
0
         $memcache && $memcache->set($cacheId, $data, MEMCACHE_COMPRESSED, 60 * 15);
         httpResponse($data);
     }
     break;
 case validateRoute('GET', 'statistics'):
     $stats = new Statistics($db, $user);
     $data = $stats->getAllStats($_GET);
     httpResponse($data);
     break;
 case validateRoute('GET', 'swetv/channels'):
     $swetv = new SweTv($db);
     httpResponse($swetv->getChannels());
     break;
 case validateRoute('GET', 'swetv/programs/\\d+'):
     $swetv = new SweTv($db);
     httpResponse($swetv->getPrograms((int) $params[2]));
     break;
 case validateRoute('GET', 'swetv/guess/\\S+'):
     $swetv = new SweTv($db);
     list($channel, $program) = $swetv->guessChannelAndProgram($params[2]);
     httpResponse(array("channel" => $channel, "program" => $program));
     break;
 case validateRoute('GET', 'logs'):
     $logs = new Logs($db, $user);
     list($data, $totalCount) = $logs->get($_GET["limit"], $_GET["index"], $_GET["search"]);
     httpResponse($data, $totalCount);
     break;
 case validateRoute('GET', 'bonus-shop'):
     $bonusShop = new BonusShop($db, $user);
     httpResponse($bonusShop->getShopItems());
     break;