Alaouy\Youtube\Youtube::searchAdvanced PHP Méthode

searchAdvanced() public méthode

Generic Search interface, use any parameters specified in the API reference
public searchAdvanced ( $params, $pageInfo = false ) : array
$params
$pageInfo
Résultat array
    public function searchAdvanced($params, $pageInfo = false)
    {
        $API_URL = $this->getApi('search.list');
        if (empty($params) || !isset($params['q'])) {
            throw new \InvalidArgumentException('at least the Search query must be supplied');
        }
        $apiData = $this->api_get($API_URL, $params);
        if ($pageInfo) {
            return array('results' => $this->decodeList($apiData), 'info' => $this->page_info);
        } else {
            return $this->decodeList($apiData);
        }
    }