xabbuh / panda-client

basic PHP client for the Panda encoding service
MIT License
14 stars 5 forks source link

Response brings back empty objects #4

Closed mykebates closed 10 years ago

mykebates commented 10 years ago

Just curious if anyone else is seeing this at all? I recently updated panda-client from an old dev version and after updating the calls my response brings back an array of empty objects.

Using the following

use Xabbuh\PandaClient\Api;
Route::get('pandaTest', function()
{

    $cloud = Api::getCloudInstance(
        $accessKey,
        $secretKey,
        $apiHost,
        $cloudId
    );

    $videos = $cloud->getEncodings();

    return $videos;
});
stof commented 10 years ago

getEncodings() reutns an array of Xabbuh\PandaClient\Model\Encoding objects. If you just json_encode them, you will indeed get empty JSON objects because of the way PHP encodes objects (it encodes public properties only, and there is none)

mykebates commented 10 years ago

Ah yeah, that makes sense. Same concept applies then for getVideos(), yes? <- was yielding the same empty objects in my execution.

stof commented 10 years ago

yep, except it will be an array of Video objects

mykebates commented 10 years ago

Got it! Thanks for the quick info.

Using this package to power a site I am slowly working on https://quipvid.com

Thanks for your work on this package :)

xabbuh commented 10 years ago

@mykebates Nice to read that. :) Feel free to open new issues if you think you found a bug.