public function get_category_list()
    {
        $cat = [];
        $url_cat = sprintf('%s?hl=%s', self::CATEGORY_URL, $this->get_locale());

        if (false === $cxml = simplexml_load_file($url_cat)) {
            throw new Bridge_Exception_ApiConnectorRequestFailed('Failed to retrive youtube categories');
        }

        $cxml->registerXPathNamespace('atom', 'http://www.w3.org/2005/Atom');
        $categories = $cxml->xpath('//atom:category');

        foreach ($categories as $c) {
            $cat[(string) $c['term']] = (string) $c['label'];
        }

        return $cat;
    }
public function get_category_list()
    {
        $cat = [];
        $url_cat = sprintf('%s?hl=%s', self::CATEGORY_URL, $this->get_locale());

        if (false === $cxml = simplexml_load_file($url_cat)) {
            throw new Bridge_Exception_ApiConnectorRequestFailed('Failed to retrive youtube categories');
        }

        $cxml->registerXPathNamespace('atom', 'http://www.w3.org/2005/Atom');
        $categories = $cxml->xpath('//atom:category');

        foreach ($categories as $c) {
            $cat[(string) $c['term']] = (string) $c['label'];
        }

        return $cat;
    }
public function get_category_list ( ) { $ cat = [ ] ; $ url_cat = sprintf ( '%s?hl=%s' , self :: CATEGORY_URL , $ this -> get_locale ( ) ) ; if ( false === $ cxml = simplexml_load_file ( $ url_cat ) ) { throw new Bridge_Exception_ApiConnectorRequestFailed ( 'Failed to retrive youtube categories' ) ; } $ cxml -> registerXPathNamespace ( 'atom' , 'http://www.w3.org/2005/Atom' ) ; $ categories = $ cxml -> xpath ( '//atom:category' ) ; foreach ( $ categories as $ c ) { $ cat [ ( string ) $ c [ 'term' ] ] = ( string ) $ c [ 'label' ] ; } return $ cat ; }
get available youtube categories as an array

@return array
get available youtube categories as an array