chargebee / chargebee-php

PHP library for the Chargebee API.
https://apidocs.chargebee.com/docs/api?lang=php
MIT License
72 stars 62 forks source link

Update ChargeBee_Model to support various return formats #16

Closed claw68 closed 7 years ago

claw68 commented 8 years ago

Using a ChargeBee object as string will return errors since it doesn't support it at the moment. By utilizing PHP's magic method: toString, it will try to convert it to string using this method. Also added toArray and __toJSON standard methods to make room for further customization to return.

jkindness commented 8 years ago

Thanks for this. A simple return $this->_values function has been needed for so long. Anyone using this as part of their restAPI would largely benefit from this. Please consider adding it to the master version.

bacheson commented 8 years ago

+1