Get all images for an artist on Last.fm.
@param array $methodVars An array with the following values: <i>artist</i> or <i>mbid</i>
@return array
765534
public function getImages($methodVars)
    {
        $vars = array(
            'method' => 'artist.getinfo',
            'api_key' => $this->auth->apiKey
        );
        $vars = array_merge($vars, $methodVars);

        if ($call = $this->apiGetCall($vars)) {
            $info['image']['small'] = isset($call->artist->image[0]) ? (string) $call->artist->image[0] : null;
            $info['image']['medium'] = isset($call->artist->image[1]) ? (string) $call->artist->image[1] : null;
            $info['image']['large'] = isset($call->artist->image[2]) ? (string) $call->artist->image[2] : null;
            $info['image']['extralarge'] = isset($call->artist->image[3]) ? (string) $call->artist->image[3] : null;
            $info['image']['mega'] = isset($call->artist->image[4]) ? (string) $call->artist->image[4] : null;

            return $info;
        } else {
            return false;
        }
    }
1336953
public function getTopTracks($methodVars)
    {
        $vars = array(
            'method' => 'chart.gettoptracks',
            'api_key' => $this->auth->apiKey
        );
        $vars = array_merge($vars, $methodVars);

        if ($call = $this->apiGetCall($vars)) {
            $i = 0;
            foreach ($call->tracks->track as $track) {
                $topTracks[$i]['name'] = (string) $track->name;
                $topTracks[$i]['playcount'] = (string) $track->playcount;
                $topTracks[$i]['listeners'] = (string) $track->listeners;
                $topTracks[$i]['mbid'] = (string) $track->mbid;
                $topTracks[$i]['url'] = (string) $track->url;
                $topTracks[$i]['streamable'] = (string) $track->streamable;
                $topTracks[$i]['fulltrack'] = (string) $track->streamable['fulltrack'];
                $topTracks[$i]['artist']['name'] = (string) $track->artist->name;
                $topTracks[$i]['artist']['mbid'] = (string) $track->artist->mbid;
                $topTracks[$i]['artist']['url'] = (string) $track->artist->url;
                $topTracks[$i]['image']['small'] = (string) $track->image[0];
                $topTracks[$i]['image']['medium'] = (string) $track->image[1];
                $topTracks[$i]['image']['large'] = (string) $track->image[2];
//                $topTracks[$i]['image']['extralarge'] = (string) $track->image[3];
//                $topTracks[$i]['image']['mega'] = (string) $track->image[4];
                $i++;
            }

            return $topTracks;
        } else {
            return false;
        }
    }
199327
public function getTopTags($methodVars)
    {
        $vars = array(
            'method' => 'chart.gettoptags',
            'api_key' => $this->auth->apiKey
        );
        $vars = array_merge($vars, $methodVars);

        if ($call = $this->apiGetCall($vars)) {
            $i = 0;
            foreach ($call->tags->tag as $tags) {
                $topTags[$i]['name'] = (string) $tags->name;
                $topTags[$i]['playcount'] = (string) $tags->playcount;
                $topTags[$i]['listeners'] = (string) $tags->listeners;
                $topTags[$i]['mbid'] = (string) $tags->mbid;
                $topTags[$i]['url'] = (string) $tags->url;
                $topTags[$i]['streamable'] = (string) $tags->streamable;
                $topTags[$i]['image']['small'] = (string) $tags->image[0];
                $topTags[$i]['image']['medium'] = (string) $tags->image[1];
                $topTags[$i]['image']['large'] = (string) $tags->image[2];
                $topTags[$i]['image']['extralarge'] = (string) $tags->image[3];
                $topTags[$i]['image']['mega'] = (string) $tags->image[4];
                $i++;
            }

            return $topTags;
        } else {
            return false;
        }
    }
1208733
public function getArtist($artistId)
    {
        $headers = $this->authHeaders();

        $artistId = $this->uriToId($artistId, 'artist');
        $uri = '/v1/artists/' . $artistId;

        $this->lastResponse = $this->request->api('GET', $uri, [], $headers);

        return $this->lastResponse['body'];
    }
1181518
public function getTopTracks($methodVars)
    {
        // Check for required variables
        if (!empty($methodVars['user'])) {
            $vars = array(
                'method' => 'user.gettoptracks',
                'api_key' => $this->auth->apiKey
            );
            $vars = array_merge($vars, $methodVars);

            if ($call = $this->apiGetCall($vars)) {
                if (count($call->toptracks->track) > 0) {
                    $i = 0;
                    foreach ($call->toptracks->track as $track) {
                        $toptracks[$i]['name'] = (string) $track->name;
                        $toptracks[$i]['rank'] = (string) $track['rank'];
                        $toptracks[$i]['playcount'] = (string) $track->playcount;
                        $toptracks[$i]['mbid'] = (string) $track->mbid;
                        $toptracks[$i]['url'] = (string) $track->url;
                        $toptracks[$i]['streamable'] = (string) $track->streamable;
                        $toptracks[$i]['fulltrack'] = (string) $track->streamable['fulltrack'];
                        $toptracks[$i]['artist']['name'] = (string) $track->artist->name;
                        $toptracks[$i]['artist']['mbid'] = (string) $track->artist->mbid;
                        $toptracks[$i]['artist']['url'] = (string) $track->artist->url;
                        $toptracks[$i]['images']['small'] = (string) $track->image[0];
                        $toptracks[$i]['images']['medium'] = (string) $track->image[1];
                        $toptracks[$i]['images']['large'] = (string) $track->image[2];
                        $i++;
                    }

                    return $toptracks;
                } else {
                    throw new NoResultsException('This user has no top tracks');
                }
            } else {
                return false;
            }
        } else {
            throw new InvalidArgumentException('You must include artist variable in the call for this method');
        }
    }
1035620
public function print_vars($vars)
    {
        $this->last_selector = null;

        $args = array();
        foreach (func_get_args() as $name => $arg) {
            if (is_object($arg)) {
                $arg = get_object_vars($arg);
            }
            $args[$name] = array(var_export($arg, true));
        }

        return $this->cmd(6, $args);
    }
717369
public function getTopFans($methodVars)
    {
        // Check for required variables
        if (!empty($methodVars['artist']) || !empty($methodVars['mbid'])) {
            $vars = array(
                'method' => 'artist.gettopfans',
                'api_key' => $this->auth->apiKey
            );
            $vars = array_merge($vars, $methodVars);

            if ($call = $this->apiGetCall($vars)) {
                if (count($call->topfans->user) > 0) {
                    $i = 0;
                    foreach ($call->topfans->user as $user) {
                        $topFans[$i]['name'] = (string) $user->name;
                        $topFans[$i]['url'] = (string) $user->url;
                        $topFans[$i]['image']['small'] = (string) $user->image[0];
                        $topFans[$i]['image']['medium'] = (string) $user->image[1];
                        $topFans[$i]['image']['large'] = (string) $user->image[2];
                        $topFans[$i]['weight'] = (string) $user->weight;
                        $i++;
                    }

                    return $topFans;
                } else {
                    throw new NoResultsException('Artist has no top users');
                }
            } else {
                return false;
            }
        } else {
            throw new InvalidArgumentException('You must include artist varialbe in the call for this method');
        }
    }
336687
public static function getString(&$var, $values = null)
    {
        if (!is_string($var)) {
            $var = '';
        }
        if ($values !== null) {
            return in_array($var, $values, true) ? $var : $values[0];
        }

        return $var;
    }
799424
public function getInfo($methodVars)
    {
        // Set the call variables
        $vars = array(
            'method' => 'album.getinfo',
            'api_key' => $this->getAuth()->apiKey
        );
        $vars = array_merge($vars, $methodVars);

        $info = array();
        $i = 0;
        if ($call = $this->apiGetCall($vars)) {
            $info['name'] = (string) $call->album->name;
            $info['artist'] = (string) $call->album->artist;
            $info['lastfmid'] = (string) $call->album->id;
            $info['mbid'] = (string) $call->album->mbid;
            $info['url'] = (string) $call->album->url;
            $info['releasedate'] = strtotime(trim((string) $call->album->releasedate));
            $info['image']['small'] = (string) $call->album->image;
            $info['image']['medium'] = (string) $call->album->image[1];
            $info['image']['large'] = (string) $call->album->image[2];
            $info['listeners'] = (string) $call->album->listeners;
            $info['playcount'] = (string) $call->album->playcount;
            foreach ($call->album->tags->tag as $tags) {
                $info['toptags'][$i]['name'] = (string) $tags->name;
                $info['toptags'][$i]['url'] = (string) $tags->url;
                $i++;
            }
            $i = 0;
            foreach ($call->album->tracks->track as $track) {
                $info['tracks'][$i]['name'] = (string) $track->name;
                $info['tracks'][$i]['url'] = (string) $track->url;
                $info['tracks'][$i]['duration'] = (string) $track->duration;
                $info['tracks'][$i]['streamable'] = (string) $track->streamable;
                $info['tracks'][$i]['rank'] = (string) $track['rank'];
                $info['tracks'][$i]['artist'] = array();
                $info['tracks'][$i]['artist']['name'] = $track->artist->name;
                $info['tracks'][$i]['artist']['mbid'] = $track->artist->mbid;
                $info['tracks'][$i]['artist']['url'] = $track->artist->url;
                $i++;
            }
            $info['wiki'] = array(
                'summary' => (string) $call->album->wiki->summary,
                'content' => (string) $call->album->wiki->content
            );

            return $info;
        } else {
            return false;
        }
    }
703294
public function addTags($methodVars) {
		// Only allow full authed calls
		if ( $this->fullAuth == true ) {
			// Check for required variables
			if ( !empty($methodVars['artist']) && !empty($methodVars['track']) && !empty($methodVars['tags']) ) {
				// If the tags variables is an array build a CS list
				if ( is_array($methodVars['tags']) ) {
					$tags = '';
					foreach ( $methodVars['tags'] as $tag ) {
						$tags .= $tag.',';
					}
					$tags = substr($tags, 0, -1);
				}
				else {
					$tags = $methodVars['tags'];
				}
				$methodVars['tags'] = $tags;

				$vars = array(
					'method' => 'track.addtags',
					'api_key' => $this->auth->apiKey,
					'sk' => $this->auth->sessionKey
				);
				$vars = array_merge($vars, $methodVars);
				$sig = $this->apiSig($this->auth->apiSecret, $vars);
				$vars['api_sig'] = $sig;

				if ( $call = $this->apiPostCall($vars) ) {
					return true;
				}
				else {
					return false;
				}
			}
			else {
				throw new InvalidArgumentException('You must include artist, track and tags varialbes in the call for this method');
			}
		}
		else {
			throw new NotAuthenticatedException('Method requires full auth. Call auth.getSession using lastfmApiAuth class');
		}
	}
767603
public function dump_vars($vars)
    {
        $this->last_selector = null;
        $args = array();
        foreach (func_get_args() as $index => $func) {
            if ($func instanceof PheryResponse || $func instanceof PheryFunction) {
                $args[$index] = array($this->typecast($func, true, true));
            } elseif (is_object($func)) {
                $args[$index] = array(get_object_vars($func));
            } else {
                $args[$index] = array($func);
            }
        }

        return $this->cmd(6, $args);
    }
756866
public function getGallery($ids)
    {
        if (empty($ids) || $ids === '{}' || $ids === '[]') return null;

        $ids = $this->parseGalleryIds($ids);

        $placeholders = implode(',', array_fill(0, count($ids), '?'));

        $imageModel = $this->getImageModelName();

        $gallery = call_user_func_array([$imageModel, 'whereIn'], ['id', $ids]);
        $gallery = $gallery
            ->orderByRaw('field(id,' . $placeholders . ')', $ids)
            ->get();

        return (count($gallery) > 0) ? $gallery : null;
    }
250512
public function getTopArtists($methodVars)
    {
        // Check for required variables
        if (!empty($methodVars['tag'])) {
            $vars = array(
                'method' => 'tag.gettopartists',
                'api_key' => $this->auth->apiKey
            );
            $vars = array_merge($vars, $methodVars);

            if ($call = $this->apiGetCall($vars)) {
                $i = 0;
                foreach ($call->topartists->artist as $artist) {
                    $topArtists[$i]['name'] = (string) $artist->name;
                    $topArtists[$i]['tagcount'] = (string) $artist->tagcount;
                    $topArtists[$i]['url'] = (string) $artist->url;
                    $topArtists[$i]['mbid'] = (string) $artist->mbid;
                    $topArtists[$i]['streamable'] = (string) $artist->streamable;
                    $topArtists[$i]['image']['small'] = (string) $artist->image[0];
                    $topArtists[$i]['image']['medium'] = (string) $artist->image[1];
                    $topArtists[$i]['image']['large'] = (string) $artist->image[2];
                    $i++;
                }
                return $topArtists;
            } else {
                return false;
            }
        } else {
            throw new InvalidArgumentException('You must include tag variable in the call for this method');
        }
    }
268194
public function getWeeklyChartList($methodVars)
    {
        // Check for required variables
        if (!empty($methodVars['user'])) {
            $vars = array(
                'method' => 'user.getweeklychartlist',
                'api_key' => $this->auth->apiKey
            );
            $vars = array_merge($vars, $methodVars);

            if ($call = $this->apiGetCall($vars)) {
                $i = 0;
                foreach ($call->weeklychartlist->chart as $chart) {
                    $weeklychartlist[$i]['from'] = (string) $chart['from'];
                    $weeklychartlist[$i]['to'] = (string) $chart['to'];
                    $i++;
                }

                return $weeklychartlist;
            } else {
                return false;
            }
        } else {
            throw new InvalidArgumentException('You must include artist variable in the call for this method');
        }
    }
829499
public function getPlaylists($methodVars)
    {
        // Check for required variables
        if (!empty($methodVars['user'])) {
            $vars = array(
                'method' => 'user.getplaylists',
                'api_key' => $this->auth->apiKey
            );
            $vars = array_merge($vars, $methodVars);

            if ($call = $this->apiGetCall($vars)) {
                if (count($call->playlists->playlist) > 0) {
                    $i = 0;
                    foreach ($call->playlists->playlist as $playlist) {
                        $playlists[$i]['id'] = (string) $playlist->id;
                        $playlists[$i]['title'] = (string) $playlist->title;
                        $playlists[$i]['date'] = strtotime(trim((string) $playlist->date));
                        $playlists[$i]['size'] = (string) $playlist->size;
                        $playlists[$i]['streamalbe'] = (string) $playlist->streamable;
                        $playlists[$i]['creator'] = (string) $playlist->creator;
                        $i++;
                    }

                    return $playlists;
                } else {
                    throw new NoResultsException('This user has no past events');
                }
            } else {
                return false;
            }
        } else {
            throw new InvalidArgumentException('You must include artist variable in the call for this method');
        }
    }
881351
protected function getJSTemplateVars($vars)
    {
        if (is_array($vars)) {
            return $vars;
        }
        
        if ($this->hasMethod($vars)) {
            return $this->{$vars}();
        }
        
        return [];
    }
438228
public function getBindingsAsVars( $vars = array() )
	{
		// $vars = array_merge( $existingVars, $this->parameters );
		$vars = $this->getParametersAsVars( $vars );

		foreach( $this->factVariableBindings as $bindingQName => /** @var \XBRL\Formulas\factVariableBinding $varBinding */ $varBinding )
		{
			if ( $varBinding->isFallback )
			{
				$current = $varBinding->yieldedFact;
			}
			else
			{
				// Using current makes sure the fact is set and the binding variables are correct
				if ( ! $varBinding->valid() ) $varBinding->rewind();
				$current = $varBinding->current();
			}
			if ( $current instanceof XPath2NodeIterator ) $current->Reset();
			$vars[ $bindingQName ] = $current;
			$vars = array_merge( $vars, $varBinding->getAdditionalVars() );
		}

		foreach( $this->generalVariableBindings as $bindingQName => /** @var VariableBinding $varBinding */ $varBinding )
		{
			// Using current makes sure the fact is set and the binding variables are correct
			// $vars[ $bindingQName ] = $this->variablesByQName[ $bindingQName ]->bindAsSequence ? $varBinding->facts : $varBinding->current();
			if ( ! $varBinding->valid() ) $varBinding->rewind();
			$current = $varBinding->current();
			if ( $current instanceof XPath2NodeIterator )
			{
				// BMS 2018-04-04 Test 0023 V-03 fails because the vars are being reset presumably because a var is not a clone
				$current = $current->CloneInstance();
				$current->Reset();
			}
			else if ( $current instanceof XPathNavigator)
			{
				$current = $current->CloneInstance();
			}
			$vars[ $bindingQName ] = $current;
		}

		return $vars;
	}