public function request($type, $params = array())
    {
        if (isset($this->iTunesConfig['api'])) {
            if (
                isset($this->iTunesConfig['api']['url']) &&
                isset($this->iTunesConfig['api']['search_uri']) &&
                isset($this->iTunesConfig['api']['lookup_uri'])
            ) {
                $host = $this->iTunesConfig['api']['url'];

                switch ($type) {
                    case 'search':
                    default:
                        $uri = $this->iTunesConfig['api']['search_uri'];
                        $params = array_merge(
                            array(
                                'limit' => isset($this->iTunesConfig['limit']) ? $this->iTunesConfig['limit'] : 50,
                            ),
                            $params
                        );
                    break;

                    case 'lookup':
                        $uri = $this->iTunesConfig['api']['lookup_uri'];
                    break;
                }

                return array(
                    'url' => $host.$uri,
                    'params' => $params,
                );
            }
        }

        throw new ConfigurationException('Incomplete Configuration');
    }
public function request($type, $params = array())
    {
        if (isset($this->iTunesConfig['api'])) {
            if (
                isset($this->iTunesConfig['api']['url']) &&
                isset($this->iTunesConfig['api']['search_uri']) &&
                isset($this->iTunesConfig['api']['lookup_uri'])
            ) {
                $host = $this->iTunesConfig['api']['url'];

                switch ($type) {
                    case 'search':
                    default:
                        $uri = $this->iTunesConfig['api']['search_uri'];
                        $params = array_merge(
                            array(
                                'limit' => isset($this->iTunesConfig['limit']) ? $this->iTunesConfig['limit'] : 50,
                            ),
                            $params
                        );
                    break;

                    case 'lookup':
                        $uri = $this->iTunesConfig['api']['lookup_uri'];
                    break;
                }

                return array(
                    'url' => $host.$uri,
                    'params' => $params,
                );
            }
        }

        throw new ConfigurationException('Incomplete Configuration');
    }
public function request ( $ type , $ params = array ( ) ) { if ( isset ( $ this -> iTunesConfig [ 'api' ] ) ) { if ( isset ( $ this -> iTunesConfig [ 'api' ] [ 'url' ] ) && isset ( $ this -> iTunesConfig [ 'api' ] [ 'search_uri' ] ) && isset ( $ this -> iTunesConfig [ 'api' ] [ 'lookup_uri' ] ) ) { $ host = $ this -> iTunesConfig [ 'api' ] [ 'url' ] ; switch ( $ type ) { case 'search' : default : $ uri = $ this -> iTunesConfig [ 'api' ] [ 'search_uri' ] ; $ params = array_merge ( array ( 'limit' => isset ( $ this -> iTunesConfig [ 'limit' ] ) ? $ this -> iTunesConfig [ 'limit' ] : 50 , ) , $ params ) ; break ; case 'lookup' : $ uri = $ this -> iTunesConfig [ 'api' ] [ 'lookup_uri' ] ; break ; } return array ( 'url' => $ host . $ uri , 'params' => $ params , ) ; } } throw new ConfigurationException ( 'Incomplete Configuration' ) ; }
Builds up the request array.

@param string $type   supported: search | lookup
@param string $term
@param array  $params

@return array
Builds up the request array .