You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you search for something, the actual type of Entity returned is quite sparse. For example:
$client = newSpotifyClient($clientId, $clientSecret);
$searchResults = $client->search->query(
newFilterQuery(
upc: $upc
),
newSearchFilter(EntityType::album),
);
/** @var SHIFT\Spotify\Entity\Album $album - this is the object we're talking about **/$album = $searchResults->albums->items[0];
echo$album->name; // this works fineecho$album->artists[0]->name; // there are no artists!echo$album->label; // there is no label!
To fix this, an extra call is required to "get" the full album details:
$album = $client->albums->get($searchResults->albums->items[0]->id);
// Now we can see $album->artists, $album->label, etc.
This makes sense to avoid recursive large objects, but it should be indicated to the developer that this is happening.
My first idea was to return an SearchResultAlbum instead of Album, and all SearchResult types should have a method to return an inflated version of the Entity they represent.
The text was updated successfully, but these errors were encountered:
When you search for something, the actual type of Entity returned is quite sparse. For example:
To fix this, an extra call is required to "get" the full album details:
This makes sense to avoid recursive large objects, but it should be indicated to the developer that this is happening.
My first idea was to return an
SearchResultAlbum
instead ofAlbum
, and allSearchResult
types should have a method to return an inflated version of the Entity they represent.The text was updated successfully, but these errors were encountered: