| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | namespace vfalies\tmdb\Results; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  | use vfalies\tmdb\Abstracts\Results; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  | use vfalies\tmdb\Tmdb; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  | use vfalies\tmdb\Interfaces\Results\TVShowResultsInterface; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  | use vfalies\tmdb\Traits\ElementTrait; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  | use vfalies\tmdb\Traits\Results\ShowTrait; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  | class TVShow extends Results implements TVShowResultsInterface | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  |     use ElementTrait; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  |     use ShowTrait; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  |     protected $overview       = null; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  |     protected $release_date   = null; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  |     protected $original_title = null; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  |     protected $title          = null; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  |     protected $backdrop_path  = null; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  |     protected $poster_path    = null; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |      * Constructor | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |      * @param \vfalies\tmdb\Tmdb $tmdb | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |      * @param \stdClass $result | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 | 6 |  |     public function __construct(Tmdb $tmdb, \stdClass $result) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 | 6 |  |         array_push($this->property_blacklist, 'release_date'); // For renaming first_air_date to release_date | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 | 6 |  |         array_push($this->property_blacklist, 'original_title'); // For renaming original_name to original_title | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 | 6 |  |         array_push($this->property_blacklist, 'title'); // For renaming name to title | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |          | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 | 6 |  |         parent::__construct($tmdb, $result); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |         // Populate data | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 | 6 |  |         $this->id             = $this->data->id; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 | 6 |  |         $this->overview       = $this->data->overview; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 | 6 |  |         $this->release_date   = $this->data->first_air_date; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 | 6 |  |         $this->original_title = $this->data->original_name; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 | 6 |  |         $this->title          = $this->data->name; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 | 6 |  |         $this->poster_path    = $this->data->poster_path; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 | 6 |  |         $this->backdrop_path  = $this->data->backdrop_path; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 | 6 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  | //    /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  | //     * Get tvshow ID | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  | //     * @return int | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  | //     */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  | //    public function getId() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  | //    { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  | //        return (int) $this->id; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  | //    } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  | // | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  | //    /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  | //     * Get tvshow overview | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  | //     * @return string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  | //     */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  | //    public function getOverview() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  | //    { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  | //        return $this->overview; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  | //    } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  | // | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  | //    /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  | //     * Get tvshow first air date | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  | //     * @return string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  | //     */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  | //    public function getReleaseDate() | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 70 |  |  | //    { | 
            
                                                                        
                            
            
                                    
            
            
                | 71 |  |  | //        return $this->release_date; | 
            
                                                                        
                            
            
                                    
            
            
                | 72 |  |  | //    } | 
            
                                                                        
                            
            
                                    
            
            
                | 73 |  |  | // | 
            
                                                                        
                            
            
                                    
            
            
                | 74 |  |  | //    /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  | //     * Get tvshow original name | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  | //     * @return string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  | //     */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  | //    public function getOriginalTitle() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  | //    { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  | //        return $this->original_title; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  | //    } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  | // | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  | //    /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  | //     * Get tvshow name | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 |  |  | //     * @return string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  | //     */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 |  |  | //    public function getTitle() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  | //    { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  | //        return $this->name; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  | //    } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 91 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 92 |  |  |  |