PokemonTCG / pokemon-tcg-sdk-php

Pokémon TCG SDK - PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

get images

rodblochon opened this issue · comments

Hi

I'd like to develop pokemon TCG app to manage my personal collection of cards with php/mysql.
Your code is fantastic but i prefer to have the images of the cards in local library, not requesting images.pokemontcg.io server
Is it possible?

Best

Hopefully you got this figured out before now, but I'll throw something out anyhow. :)

If you want to use local images, you'll just need to reference them instead of the images provided by the API.

Ex)
Instead of
$card->getImageUrlHiRes();
you'd use
'my/local/path/' . $card->getSetCode() . '/' . $card->getNumber() . '_hires.png'

If you wanted to avoid that bit of ugliness in your code, you could add a method (something like $card->getLocalImageUrlHiRes() to the Card model for your project.

However, if you go that route, you may want to extend the Card, create a trait, or similar. The intent being to keep any direct modifications out of your local copy of the SDK.