| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  |  * This file is part of the Tmdb package. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * (c) Vincent Faliès <[email protected]> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  * For the full copyright and license information, please view the LICENSE | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |  * file that was distributed with this source code. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  * @author Vincent Faliès <[email protected]> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |  * @copyright Copyright (c) 2017 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  | namespace vfalies\tmdb; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  | use vfalies\tmdb\Catalogs\Genres; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  | use vfalies\tmdb\Catalogs\Jobs; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  | use vfalies\tmdb\Interfaces\TmdbInterface; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  |  * Catalog class | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |  * @package Tmdb | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |  * @author Vincent Faliès <[email protected]> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |  * @copyright Copyright (c) 2017 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  | class Catalog | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |      * Tmdb object | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |      * @var TmdbInterface | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |     private $tmdb = null; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  |      * Logger | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |      * @var \Psr\Log\LoggerInterface | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |     private $logger = null; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |      * Constructor | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |      * @param vfalies\tmdb\Interfaces\TmdbInterface $tmdb | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 43 |  |  |      */ | 
            
                                                                        
                            
            
                                    
            
            
                | 44 | 7 |  |     public function __construct(TmdbInterface $tmdb) | 
            
                                                                        
                            
            
                                    
            
            
                | 45 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 46 | 7 |  |         $this->tmdb   = $tmdb; | 
            
                                                                        
                            
            
                                    
            
            
                | 47 | 7 |  |         $this->logger = $tmdb->getLogger(); | 
            
                                                                        
                            
            
                                    
            
            
                | 48 | 7 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |      * Get movie genres list | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |      * @param array $options | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |      * @return \Generator | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 | 3 |  |     public function getMovieGenres(array $options = array()) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 | 3 |  |         $this->logger->debug('Starting getting movie genres'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 | 3 |  |         $catalog = new Genres($this->tmdb); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 | 3 |  |         return $catalog->getMovieList($options); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |      * Get TVShow genres list | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |      * @param array $options | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |      * @return \Generator | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 | 2 |  |     public function getTVShowGenres(array $options = array()) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 | 2 |  |         $this->logger->debug('Starting getting tv show genres'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 | 2 |  |         $catalog = new Genres($this->tmdb); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 | 2 |  |         return $catalog->getTVList($options); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  |      * Get Job list | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  |      * @param array $options | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  |      * @return \Generator|\stdClass | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 | 2 |  |     public function getJobsList(array $options = array()) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 | 2 |  |         $this->logger->debug('Starting getting jobs list'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 | 2 |  |         $catalog = new Jobs($this->tmdb); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 | 2 |  |         return $catalog->getList($options); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 85 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 86 |  |  |  |