Contents

ORM Classes

The fORMJSON class is an ORM plugin to provide JSON encoding functionality to fActiveRecord and fRecordSet objects.

Enabling

To add the JSON encoding functionality for whole records and record sets, simply call the static method extend().

fORMJSON::extend();

Usage

The fORMJSON class adds a toJSON() method to both fActiveRecord and fRecordSet. Calling toJSON() on a record will create a single JSON object with each column being the property name and the value being the value. Calling toJSON() on a record set will create an array of the record JSON objects.