public
|
#
__construct( mixed $data = null )
Constructor
Parameters
- $data
mixed - $data The data to bind to the new Registry object.
Since
1.0
|
public
Joomla\Registry\Registry
|
#
__clone( )
Magic function to clone the registry object.
Magic function to clone the registry object.
Returns
Since
1.0
|
public
string
|
#
__toString( )
Magic function to render this object as a string using default args of
toString method.
Magic function to render this object as a string using default args of
toString method.
Returns
string
Since
1.0
|
public
integer
|
#
count( )
Count elements of the data object
Count elements of the data object
Returns
integer - The custom count as an integer.
Since
1.3.0
Link
Implementation of
|
public
object
|
#
jsonSerialize( )
Implementation for the JsonSerializable interface. Allows us to pass Registry
objects to json_encode.
Implementation for the JsonSerializable interface. Allows us to pass Registry
objects to json_encode.
Returns
object
Since
1.0
Note
The interface is only present in PHP 5.4 and up.
Implementation of
|
public
mixed
|
#
def( string $key, mixed $default = '' )
Sets a default value if not already assigned.
Sets a default value if not already assigned.
Parameters
- $key
string - $key The name of the parameter.
- $default
mixed - $default An optional value for the parameter.
Returns
mixed - The value set, or the default if the value was not previously set (or null).
Since
1.0
|
public
boolean
|
#
exists( string $path )
Check if a registry path exists.
Check if a registry path exists.
Parameters
- $path
string - $path Registry path (e.g. joomla.content.showauthor)
Returns
boolean
Since
1.0
|
public
mixed
|
#
get( string $path, mixed $default = null )
Get a registry value.
Parameters
- $path
string - $path Registry path (e.g. joomla.content.showauthor)
- $default
mixed - $default Optional default value, returned if the internal value is null.
Returns
mixed - Value of entry or null
Since
1.0
|
public static
Joomla\Registry\Registry
|
#
getInstance( string $id )
Returns a reference to a global Registry object, only creating it if it
doesn't already exist.
Returns a reference to a global Registry object, only creating it if it
doesn't already exist.
This method must be invoked as:
$registry = Registry::getInstance($id);
Deprecated
2.0 Instantiate a new Registry instance instead
Parameters
- $id
string - $id An ID for the registry instance
Returns
Since
1.0
|
public
ArrayIterator
|
#
getIterator( )
Gets this object represented as an ArrayIterator.
Gets this object represented as an ArrayIterator.
This allows the data properties to be accessed via a foreach statement.
Returns
Since
1.3.0
See
Implementation of
|
public
Joomla\Registry\Registry
|
#
loadArray( array $array, boolean $flattened = false, string $separator = null )
Load an associative array of values into the default namespace
Load an associative array of values into the default namespace
Parameters
- $array
array - $array Associative array of value to load
- $flattened
boolean - $flattened Load from a one-dimensional array
- $separator
string - $separator The key separator
Returns
Since
1.0
|
public
Joomla\Registry\Registry
|
#
loadObject( object $object )
Load the public variables of the object into the default namespace.
Load the public variables of the object into the default namespace.
Parameters
- $object
object - $object The object holding the publics to load
Returns
Since
1.0
|
public
Joomla\Registry\Registry
|
#
loadFile( string $file, string $format = 'JSON', array $options = array() )
Load the contents of a file into the registry
Load the contents of a file into the registry
Parameters
- $file
string - $file Path to file to load
- $format
string - $format Format of the file [optional: defaults to JSON]
- $options
array - $options Options used by the formatter
Returns
Since
1.0
|
public
Joomla\Registry\Registry
|
#
loadString( string $data, string $format = 'JSON', array $options = array() )
Load a string into the registry
Load a string into the registry
Parameters
- $data
string - $data String to load into the registry
- $format
string - $format Format of the string
- $options
array - $options Options used by the formatter
Returns
Since
1.0
|
public
Joomla\Registry\Registry
|
#
merge( Joomla\Registry\Registry $source, boolean $recursive = false )
Merge a Registry object into this one
Merge a Registry object into this one
Parameters
- $source
Joomla\Registry\Registry - $source Source Registry object to merge.
- $recursive
boolean - $recursive True to support recursive merge the children values.
Returns
Since
1.0
|
public
boolean
|
#
offsetExists( mixed $offset )
Checks whether an offset exists in the iterator.
Checks whether an offset exists in the iterator.
Parameters
- $offset
mixed - $offset The array offset.
Returns
boolean - True if the offset exists, false otherwise.
Since
1.0
Implementation of
|
public
mixed
|
#
offsetGet( mixed $offset )
Gets an offset in the iterator.
Gets an offset in the iterator.
Parameters
- $offset
mixed - $offset The array offset.
Returns
mixed - The array value if it exists, null otherwise.
Since
1.0
Implementation of
|
public
|
#
offsetSet( mixed $offset, mixed $value )
Sets an offset in the iterator.
Sets an offset in the iterator.
Parameters
- $offset
mixed - $offset The array offset.
- $value
mixed - $value The array value.
Since
1.0
Implementation of
|
public
|
#
offsetUnset( mixed $offset )
Unsets an offset in the iterator.
Unsets an offset in the iterator.
Parameters
- $offset
mixed - $offset The array offset.
Since
1.0
Implementation of
|
public
mixed
|
#
set( string $path, mixed $value, string $separator = null )
Set a registry value.
Parameters
- $path
string - $path Registry Path (e.g. joomla.content.showauthor)
- $value
mixed - $value Value of entry
- $separator
string - $separator The key separator
Returns
mixed - The value of the that has been set.
Since
1.0
|
public
mixed
|
#
append( string $path, mixed $value )
Append value to a path in registry
Append value to a path in registry
Parameters
- $path
string - $path Parent registry Path (e.g. joomla.content.showauthor)
- $value
mixed - $value Value of entry
Returns
mixed - The value of the that has been set.
Since
1.4.0
|
public
array
|
#
toArray( )
Transforms a namespace to an array
Transforms a namespace to an array
Returns
array - An associative array holding the namespace data
Since
1.0
|
public
object
|
#
toObject( )
Transforms a namespace to an object
Transforms a namespace to an object
Returns
object - An an object holding the namespace data
Since
1.0
|
public
string
|
#
toString( string $format = 'JSON', mixed $options = array() )
Get a namespace in a given string format
Get a namespace in a given string format
Parameters
- $format
string - $format Format to return the string in
- $options
mixed - $options Parameters used by the formatter, see formatters for more info
Returns
string - Namespace in string format
Since
1.0
|
protected
|
#
bindData( object $parent, mixed $data, boolean $recursive = true, boolean $allowNull = true )
Method to recursively bind data to a parent object.
Method to recursively bind data to a parent object.
Parameters
- $parent
object - $parent The parent object on which to attach the data values.
- $data
mixed - $data An array or object of data to bind to the parent object.
- $recursive
boolean - $recursive True to support recursive bindData.
- $allowNull
boolean - $allowNull True to allow null values.
Since
1.0
|
protected
array
|
#
asArray( object $data )
Method to recursively convert an object of data to an array.
Method to recursively convert an object of data to an array.
Parameters
- $data
object - $data An object of data to return as an array.
Returns
array - Array representation of the input object.
Since
1.0
|
public
string[]
|
#
flatten( string $separator = null )
Dump to one dimension array.
Dump to one dimension array.
Parameters
- $separator
string - $separator The key separator.
Returns
string[] - Dumped array.
Since
1.3.0
|
protected
|
#
toFlatten( string $separator = null, array|object $data = null, array & $array = array(), string $prefix = '' )
Method to recursively convert data to one dimension array.
Method to recursively convert data to one dimension array.
Parameters
- $separator
string - $separator The key separator.
- $data
array|object - $data Data source of this scope.
- $array
array - &$array The result array, it is pass by reference.
- $prefix
string - $prefix Last level key prefix.
Since
1.3.0
|