Source API for the «PortePlugins_Json» class

Add json import and export support to records or list of records by registering two new method "fromJson" and "toJson" to each record.

Public static methods

register

Register the plugin with a Porte instance.

_modelTableAfter

This method is not yet documented.

fromJson

The fromJson method is a simple wrapper around the fromArray method with which it share all its arguments and behavior with the difference that it expect a JSON formated string instead of an array as first argument.

return
PorteRecord
The current recored
JSON
$json, string
Various
$options, options
used to alter the behavior of the mapping
toJson

The toJson method is a simple wrapper around the toArray method with which it share all its arguments and behavior with the difference that it return a JSON formated string instead of an array.

Note, the result string is always encoded in UTF-8 as specified by the JSON specification.

return
string
JSON formated string
Various
$options, options
used to alter the behavior of the mapping