Beispiel #1
0
 /**
  * Returns the information about a show including episodes
  */
 function get_show($show_id)
 {
     // Sanitize to be safe
     $show_id = Sanitize::clean($show_id);
     // Setup query parameters
     $params = array('contain' => FALSE, 'conditions' => array('OR' => array(array('Show.id =' => $show_id), array('Show.name =' => $show_id))));
     // Perform query
     $show_info = $this->cache('first', $params);
     // Grab the episodes
     App::import('Model', 'Episode');
     $episode = new Episode();
     $show_info['Episode'] = $episode->get_episodes($show_info['Show']['id'], $show_info['Show']['season_count']);
     return $show_info;
 }