示例#1
0
 /**
  * Returns the information about a show including episodes and watched, 
  * owned data for a user.
  */
 function get_show_with_episode_user($show_id, $season, $user_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_with_user($show_info['Show']['id'], $season, $user_id);
     return $show_info;
 }