Class JRegistry

Description

Implements interfaces:

JRegistry class

  • since: 11.1

Located in /libraries/joomla/registry/registry.php (line 21)


	
			
Direct descendents
Class Description
 class JKeychain Keychain Class
Variable Summary
 static array $instances
 object $data
Method Summary
 static JRegistry getInstance (string $id)
 JRegistry __construct ([mixed $data = null])
 array asArray (object $data)
 void bindData (object $parent, mixed $data)
 mixed def (string $key, [mixed $default = ''])
 boolean exists (string $path)
 mixed get (string $path, [mixed $default = null])
 object jsonSerialize ()
 boolean loadArray (array $array)
 boolean loadFile (string $file, [string $format = 'JSON'], [array $options = array()])
 boolean loadObject (object $object)
 boolean loadString (string $data, [string $format = 'JSON'], [array $options = array()])
 boolean merge (JRegistry $source)
 mixed set (string $path, mixed $value)
 array toArray ()
 object An toObject ()
 string toString ([string $format = 'JSON'], [mixed $options = array()])
 string __toString ()
Variables
static array $instances = array() (line 35)
  • var: JRegistry instances container.
  • since: 11.3
  • access: protected
object $data (line 29)

Registry Object

  • since: 11.1
  • access: protected
Methods
static getInstance (line 217)

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

This method must be invoked as:

$registry = JRegistry::getInstance($id);

  • return: The JRegistry object.
  • since: 11.1
  • access: public
static JRegistry getInstance (string $id)
  • string $id: An ID for the registry instance
Constructor __construct (line 44)

Constructor

  • since: 11.1
  • access: public
JRegistry __construct ([mixed $data = null])
  • mixed $data: The data to bind to the new JRegistry object.
asArray (line 458)

Method to recursively convert an object of data to an array.

  • return: Array representation of the input object.
  • since: 11.1
  • access: protected
array asArray (object $data)
  • object $data: An object of data to return as an array.
bindData (line 423)

Method to recursively bind data to a parent object.

  • since: 11.1
  • access: protected
void bindData (object $parent, mixed $data)
  • object $parent: The parent object on which to attach the data values.
  • mixed $data: An array or object of data to bind to the parent object.
def (line 108)

Sets a default value if not already assigned.

  • return: The value set, or the default if the value was not previously set (or null).
  • since: 11.1
  • access: public
mixed def (string $key, [mixed $default = ''])
  • string $key: The name of the parameter.
  • mixed $default: An optional value for the parameter.
exists (line 125)

Check if a registry path exists.

  • since: 11.1
  • access: public
boolean exists (string $path)
  • string $path: Registry path (e.g. joomla.content.showauthor)
get (line 165)

Get a registry value.

  • return: Value of entry or null
  • since: 11.1
  • access: public
mixed get (string $path, [mixed $default = null])
  • string $path: Registry path (e.g. joomla.content.showauthor)
  • mixed $default: Optional default value, returned if the internal value is null.
jsonSerialize (line 93)

Implementation for the JsonSerializable interface.

Allows us to pass JRegistry objects to json_encode.

  • since: 12.2
  • access: public
object jsonSerialize ()

Implementation of:
JsonSerializable::jsonSerialize
loadArray (line 236)

Load a associative array of values into the default namespace

  • return: True on success
  • since: 11.1
  • access: public
boolean loadArray (array $array)
  • array $array: Associative array of value to load
loadFile (line 270)

Load the contents of a file into the registry

  • return: True on success
  • since: 11.1
  • access: public
boolean loadFile (string $file, [string $format = 'JSON'], [array $options = array()])
  • string $file: Path to file to load
  • string $format: Format of the file [optional: defaults to JSON]
  • array $options: Options used by the formatter
loadObject (line 252)

Load the public variables of the object into the default namespace.

  • return: True on success
  • since: 11.1
  • access: public
boolean loadObject (object $object)
  • object $object: The object holding the publics to load
loadString (line 288)

Load a string into the registry

  • return: True on success
  • since: 11.1
  • access: public
boolean loadString (string $data, [string $format = 'JSON'], [array $options = array()])
  • string $data: String to load into the registry
  • string $format: Format of the string
  • array $options: Options used by the formatter
merge (line 308)

Merge a JRegistry object into this one

  • return: True on success
  • since: 11.1
  • access: public
boolean merge (JRegistry $source)
  • JRegistry $source: Source JRegistry object to merge.
set (line 337)

Set a registry value.

  • return: The value of the that has been set.
  • since: 11.1
  • access: public
mixed set (string $path, mixed $value)
  • string $path: Registry Path (e.g. joomla.content.showauthor)
  • mixed $value: Value of entry
toArray (line 378)

Transforms a namespace to an array

  • return: An associative array holding the namespace data
  • since: 11.1
  • access: public
array toArray ()
toObject (line 390)

Transforms a namespace to an object

  • return: an object holding the namespace data
  • since: 11.1
  • access: public
object An toObject ()
toString (line 405)

Get a namespace in a given string format

  • return: Namespace in string format
  • since: 11.1
  • access: public
string toString ([string $format = 'JSON'], [mixed $options = array()])
  • string $format: Format to return the string in
  • mixed $options: Parameters used by the formatter, see formatters for more info
__clone (line 67)

Magic function to clone the registry object.

  • since: 11.1
  • access: public
JRegistry __clone ()
__toString (line 79)

Magic function to render this object as a string using default args of toString method.

  • since: 11.1
  • access: public
string __toString ()

Documentation generated on Tue, 19 Nov 2013 15:11:44 +0100 by phpDocumentor 1.4.3