Class JRegistry

Description

JRegistry class

  • since: 11.1

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


	
			
Direct descendents
Class Description
JParameter Parameter handler
Variable Summary
static array $instances
object $data
Method Summary
static object The getInstance (string $id)
JRegistry __construct ([mixed $data = null])
array asArray (object $data)
void bindData (object &$parent, mixed $data)
string def (string $key, [string $default = ''])
boolean exists (string $path)
mixed get (string $path, [mixed $default = null])
array getNameSpaces ()
mixed getValue (string $path, [mixed $default = null])
boolean loadArray (array $array)
boolean loadFile (string $file, [string $format = 'JSON'], [mixed $options = array()])
boolean loadINI (string $data, [string $namespace = null], [mixed $options = array()])
boolean loadJSON (string $data)
boolean loadObject (object $object)
boolean loadSetupFile ()
boolean loadString (string $data, [string $format = 'JSON'], [mixed $options = array()])
boolean loadXML (string $data, [string $namespace = null])
boolean makeNameSpace (string $namespace)
boolean merge (JRegistry &$source)
mixed set (string $path, mixed $value)
mixed setValue (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 36)
  • var: JRegistry instances container.
  • since: 11.3
  • access: protected
object $data (line 30)

Registry Object

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

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: JRegistry object.
  • since: 11.1
  • access: public
static object The getInstance (string $id)
  • string $id: An ID for the registry instance
Constructor __construct (line 45)

Constructor

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

Redefined in descendants as:
asArray (line 435)

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 400)

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 95)

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
string def (string $key, [string $default = ''])
  • string $key: The name of the parameter.
  • string $default: An optional value for the parameter.

Redefined in descendants as:
exists (line 111)

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 151)

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.
getNameSpaces (line 556)

Get the list of namespaces

  • return: List of namespaces
  • deprecated: 12.1
  • since: 11.1
  • access: public
array getNameSpaces ()
getValue (line 579)

Get a registry value

  • return: Value of entry or null
  • deprecated: 12.1
  • since: 11.1
  • access: public
mixed getValue (string $path, [mixed $default = null])
  • string $path: Registry path (e.g. joomla.content.showauthor)
  • mixed $default: Optional default value
loadArray (line 220)

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 254)

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'], [mixed $options = array()])
  • string $file: Path to file to load
  • string $format: Format of the file [optional: defaults to JSON]
  • mixed $options: Options used by the formatter
loadINI (line 494)

Load an INI string into the registry into the given namespace [or default if a namespace is not given]

  • return: True on success
  • deprecated: 12.1 Use loadString passing INI as the format instead.
  • since: 11.1
  • access: public
boolean loadINI (string $data, [string $namespace = null], [mixed $options = array()])
  • string $data: INI formatted string to load into the registry
  • string $namespace: Namespace to load the INI string into [optional]
  • mixed $options: An array of options for the formatter, or boolean to process sections.
loadJSON (line 515)

Load an JSON string into the registry into the given namespace [or default if a namespace is not given]

  • return: True on success
  • deprecated: 12.1 Use loadString passing JSON as the format instead.
  • since: 11.1
  • access: public
boolean loadJSON (string $data)
  • string $data: JSON formatted string to load into the registry
loadObject (line 236)

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
loadSetupFile (line 634)

This method is added as an interim solution for API references in the Joomla! CMS 1.6 to the JRegistry object where in 1.5 a JParameter object existed. Because many extensions may call this method we add it here as a means of "pain relief" until the 1.8 release.

  • return: True.
  • deprecated: 12.1
  • since: 11.1
  • access: public
boolean loadSetupFile ()

Redefined in descendants as:
loadString (line 274)

Load a string into the registry

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

Load an XML string into the registry into the given namespace [or default if a namespace is not given]

  • return: True on success
  • deprecated: 12.1 Use loadString passing XML as the format instead.
  • since: 11.1
  • access: public
boolean loadXML (string $data, [string $namespace = null])
  • string $data: XML formatted string to load into the registry
  • string $namespace: Namespace to load the XML string into [optional]
makeNameSpace (line 536)

Create a namespace

  • return: True on success
  • deprecated: 12.1
  • since: 11.1
  • access: public
boolean makeNameSpace (string $namespace)
  • string $namespace: Name of the namespace to create
merge (line 294)

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 321)

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
setValue (line 607)

Set a registry value

  • return: The value after setting.
  • deprecated: 12.1
  • since: 11.1
  • access: public
mixed setValue (string $path, mixed $value)
  • string $path: Registry Path (e.g. joomla.content.showauthor)
  • mixed $value: Value of entry
toArray (line 355)

Transforms a namespace to an array

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

Transforms a namespace to an object

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

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 68)

Magic function to clone the registry object.

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

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 Mon, 25 Jun 2012 13:59:08 -0500 by phpDocumentor 1.4.4