public function discoverMovies(DiscoverMoviesQuery $query, array $headers = [])
    {
        $query = $query->toArray();

        if (array_key_exists('certification_country', $query) && !array_key_exists('certification.lte', $query)) {
            throw new RuntimeException(
                'When the certification_country option is given the certification.lte option is required.'
            );
        }

        $data = $this->getApi()->discoverMovies($query, $headers);

        return $this->getMovieFactory()->createResultCollection($data);
    }
public function discoverMovies(DiscoverMoviesQuery $query, array $headers = [])
    {
        $query = $query->toArray();

        if (array_key_exists('certification_country', $query) && !array_key_exists('certification.lte', $query)) {
            throw new RuntimeException(
                'When the certification_country option is given the certification.lte option is required.'
            );
        }

        $data = $this->getApi()->discoverMovies($query, $headers);

        return $this->getMovieFactory()->createResultCollection($data);
    }
public function discoverMovies ( DiscoverMoviesQuery $ query , array $ headers = [ ] ) { $ query = $ query -> toArray ( ) ; if ( array_key_exists ( 'certification_country' , $ query ) && ! array_key_exists ( 'certification.lte' , $ query ) ) { throw new RuntimeException ( 'When the certification_country option is given the certification.lte option is required.' ) ; } $ data = $ this -> getApi ( ) -> discoverMovies ( $ query , $ headers ) ; return $ this -> getMovieFactory ( ) -> createResultCollection ( $ data ) ; }
Discover movies by different types of data like average rating,
number of votes, genres and certifications.

@param  DiscoverMoviesQuery $query
@param  array               $headers
@throws RuntimeException    when certification_country is set but certification.lte is not given
@return Movie[]
Discover movies by different types of data like average rating number of votes genres and certifications .