function __construct($show_data)
 {
     parent::__construct($show_data);
     $this->type = isset($show_data['type']) ? $show_data['type'] : null;
     $this->language = isset($show_data['language']) ? $show_data['language'] : null;
     $this->genres = isset($show_data['genres']) ? $show_data['genres'] : null;
     $this->status = isset($show_data['status']) ? $show_data['status'] : null;
     $this->runtime = isset($show_data['runtime']) ? $show_data['runtime'] : null;
     $this->premiered = isset($show_data['premiered']) ? $show_data['premiered'] : null;
     $this->rating = isset($show_data['rating']) ? $show_data['rating'] : null;
     $this->weight = isset($show_data['weight']) ? $show_data['weight'] : null;
     $this->network_array = isset($show_data['network']) ? $show_data['network'] : null;
     $this->network = isset($show_data['network']) ? $show_data['network']['name'] : null;
     $this->country = isset($show_data['network']) && isset($show_data['network']["country"]) ? $show_data['network']['country']['code'] : null;
     $this->webChannel = isset($show_data['webChannel']) ? $show_data['webChannel'] : null;
     $this->externalIDs = isset($show_data['externals']) ? $show_data['externals'] : null;
     $this->summary = isset($show_data['summary']) ? strip_tags($show_data['summary']) : null;
     $current_date = date("Y-m-d");
     if (isset($show_data['_embedded']) && isset($show_data['_embedded']['episodes'])) {
         foreach ($show_data['_embedded']['episodes'] as $episode) {
             if ($episode['airdate'] >= $current_date) {
                 $this->nextAirDate = $episode['airdate'];
                 $this->airTime = @date("g:i A", $episode['airtime']);
                 $this->airDay = @date('l', strtotime($episode['airdate']));
                 break;
             }
         }
     }
 }
Пример #2
0
 /**
  * @param $episode_data
  */
 function __construct($episode_data)
 {
     parent::__construct($episode_data);
     $this->season = $episode_data['season'];
     $this->number = $episode_data['number'];
     $this->airdate = $episode_data['airdate'];
     $this->airtime = $episode_data['airtime'];
     $this->airstamp = $episode_data['airstamp'];
     $this->runtime = $episode_data['runtime'];
     $this->summary = strip_tags($episode_data['summary']);
 }
Пример #3
0
 /**
  * @param $show_data
  */
 function __construct($show_data)
 {
     parent::__construct($show_data);
     $this->type = $show_data['type'];
     $this->language = $show_data['language'];
     $this->genres = $show_data['genres'];
     $this->status = $show_data['status'];
     $this->runtime = $show_data['runtime'];
     $this->premiered = $show_data['premiered'];
     $this->rating = $show_data['rating'];
     $this->weight = $show_data['weight'];
     $this->network_array = $show_data['network'];
     $this->network = $show_data['network']['name'];
     $this->country = $show_data['network']['country']['code'];
     if (count($show_data['webChannel']) > 0) {
         $this->country = $show_data['webChannel']['country']['code'];
     }
     $this->webChannel = $show_data['webChannel'];
     $this->externalIDs = $show_data['externals'];
     $this->summary = strip_tags($show_data['summary']);
     $this->akas = isset($show_data['_embedded']['akas']) ? $show_data['_embedded']['akas'] : null;
 }