Json

Extends \Joomla\Registry\AbstractRegistryFormat

JSON format handler for Registry.

since

1.0

Methods

getInstance

Returns a reference to a Format object, only creating it if it doesn't already exist.

getInstance(string $type, array $options = array()) : \Joomla\Registry\AbstractRegistryFormat
inherited static deprecated
deprecated

2.0 Use Factory::getFormat() instead

since

1.0

throws

\InvalidArgumentException

Arguments

$type

stringThe format to load

$options

arrayAdditional options to configure the object

Response

\Joomla\Registry\AbstractRegistryFormatRegistry format handler

objectToString

Converts an object into a JSON formatted string.

objectToString(object $object, array $options = array()) : string
since

1.0

Arguments

$object

objectData source object.

$options

arrayOptions used by the formatter.

Response

stringJSON formatted string.

stringToObject

Parse a JSON formatted string and convert it into an object.

stringToObject(string $data, array $options = array('processSections' => false)) : object

If the string is not in JSON format, this method will attempt to parse it as INI format.

since

1.0

throws

\RuntimeException

Arguments

$data

stringJSON formatted string to convert.

$options

arrayOptions used by the formatter.

Response

objectData object.

Properties

instances

Format instances container.

inherited static deprecated
since

1.0

deprecated

2.0 Object caching will no longer be supported

Type(s)

array<mixed,\Joomla\Registry\AbstractRegistryFormat>