brucealdridge / VendAPI

Class for accessing the api for vend on vendhq.com
Other
36 stars 22 forks source link

No method... #12

Closed iammart closed 8 years ago

iammart commented 11 years ago

Hey,

Your class has been a great starting point...

Were running PHP 5.2.9 so it needed the name spaces removing, but I just wanted to check that the issue I am having is related to this somehow :)

As per your docs Im trying to update a products inventory, but first I just want to get count.

$obj = $vend->getProduct('42c2ccc4-fbf4-11e1-b195-4040782fde00');

This is great and returns an object, but my problem is when I come to calling the method getInventory its not available. Looking into getProduct in VendAPI, it doesn't create a new VendProduct Object if a result is found. If I change this method to create a new VendProduct eg.

return is_array($result) && isset($result[0]) ? new VendProduct(null, $result[0]) : new VendProduct(null, $this);

This exposes the method but then Im having issues with iterating through the vendObjectProperties to find the inventory key now.

I would really appreciate it if you could tell me where I may be going wrong.

Cheers,