fORMJSONstatic classv1.0.0b2
Adds JSON functionality to fActiveRecord and fRecordSet
| 1.0.0b2 | Updated the code to remove the $associate parameter for the record set method callback 6/2/09 |
|---|---|
| 1.0.0b | The initial implementation 6/25/08 |
Static Methods
::extend() public
::reflect() internal public
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Adjusts the fActiveRecord::reflect() signatures of columns that have been added by this class
Signature
void reflect( string $class, array &$signatures, boolean $include_doc_comments )
Parameters
| string | $class | The class to reflect |
| array | &$signatures | The associative array of {method name} => {signature} |
| boolean | $include_doc_comments | If doc comments should be included with the signature |
::toJSON() internal public
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Returns a JSON object representation of the record
Signature
string toJSON( fActiveRecord $object, array &$values, array &$old_values, array &$related_records, array &$cache, string $method_name, array $parameters )
Parameters
| fActiveRecord | $object | The fActiveRecord instance |
| array | &$values | The current values |
| array | &$old_values | The old values |
| array | &$related_records | Any records related to this record |
| array | &$cache | The cache array for the record |
| string | $method_name | The method that was called |
| array | $parameters | The parameters passed to the method |
Returns
The JSON object that represents the values of this record
::toJSONRecordSet() internal public
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Returns a JSON object representation of a record set
Signature
string toJSONRecordSet( fRecordSet $record_set, string $class, array &$records, integer &$pointer )
Parameters
| fRecordSet | $record_set | The fRecordSet instance |
| string | $class | The class of the records |
| array | &$records | The fActiveRecord objects |
| integer | &$pointer | The current iteration pointer |
Returns
The JSON object that represents an array of all of the fActiveRecord objects
