chargebee / chargebee-php

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

[Suggestion] Add a __toString() method to ChargeBee_Model to support attempts saving it as a string #15

Closed claw68 closed 8 years ago

claw68 commented 8 years ago

On ChargeBee_Model class

public function __toString() { return json_encode($this->_values); }

claw68 commented 8 years ago

Sent pull request: Update ChargeBee_Model to support various return formats

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.

SangeethaBaskaran commented 8 years ago

Hi, The method 'toJson()' has been added to master version.