Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe Registry
+ Graphe d'héritage de Registry:

Fonctions membres publiques

 __construct ($data=null)
 
 __clone ()
 
 __toString ()
 
 count ()
 
 jsonSerialize ()
 
 def ($key, $default='')
 
 exists ($path)
 
 get ($path, $default=null)
 
 getIterator ()
 
 loadArray ($array, $flattened=false, $separator=null)
 
 loadObject ($object)
 
 loadFile ($file, $format='JSON', $options=array())
 
 loadString ($data, $format='JSON', $options=array())
 
 merge ($source, $recursive=false)
 
 extract ($path)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 set ($path, $value, $separator=null)
 
 append ($path, $value)
 
 remove ($path)
 
 toArray ()
 
 toObject ()
 
 toString ($format='JSON', $options=array())
 
 flatten ($separator=null)
 

Fonctions membres publiques statiques

static getInstance ($id)
 

Champs de données

 $separator = '.'
 

Fonctions membres protégées

 bindData ($parent, $data, $recursive=true, $allowNull=true)
 
 asArray ($data)
 
 toFlatten ($separator=null, $data=null, &$array=array(), $prefix='')
 

Attributs protégés

 $data
 
 $initialized = false
 

Attributs protégés statiques

static $instances = array()
 

Description détaillée

Registry class

Depuis
1.0

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $data = null)

Constructor

Paramètres
mixed$dataThe data to bind to the new Registry object.
Depuis
1.0

Références Registry\$data, Registry\bindData(), elseif, Registry\loadString(), et Registry\merge().

Documentation des fonctions membres

◆ __clone()

__clone ( )

Magic function to clone the registry object.

Renvoie
void
Depuis
1.0

◆ __toString()

__toString ( )

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

Renvoie
string
Depuis
1.0

Références Registry\toString().

◆ append()

append (   $path,
  $value 
)

Append value to a path in registry

Paramètres
string$pathParent registry Path (e.g. joomla.content.showauthor)
mixed$valueValue of entry
Renvoie
mixed The value of the that has been set.
Depuis
1.4.0

Références $data, $i, $n, $path, et null.

◆ asArray()

asArray (   $data)
protected

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

Paramètres
object$dataAn object of data to return as an array.
Renvoie
array Array representation of the input object.
Depuis
1.0

Références $data.

◆ bindData()

bindData (   $parent,
  $data,
  $recursive = true,
  $allowNull = true 
)
protected

Method to recursively bind data to a parent object.

Paramètres
object$parentThe parent object on which to attach the data values.
mixed$dataAn array or object of data to bind to the parent object.
boolean$recursiveTrue to support recursive bindData.
boolean$allowNullTrue to allow null values.
Renvoie
void
Depuis
1.0

Références $data, et null.

Référencé par Registry\__construct(), Registry\loadArray(), Registry\loadObject(), et Registry\merge().

◆ count()

count ( )

Count elements of the data object

Renvoie
integer The custom count as an integer.

1.3.0

Référencé par Registry\set().

◆ def()

def (   $key,
  $default = '' 
)

Sets a default value if not already assigned.

Paramètres
string$keyThe name of the parameter.
mixed$defaultAn optional value for the parameter.
Renvoie
mixed The value set, or the default if the value was not previously set (or null).
Depuis
1.0

Références $default, $key, et $value.

Référencé par JLinkedinOauth\__construct(), JFacebookOAuth\__construct(), JTwitterOAuth\__construct(), JOpenstreetmapOauth\__construct(), et AssociationsHelper\getSupportedExtension().

◆ exists()

exists (   $path)

Check if a registry path exists.

Paramètres
string$pathRegistry path (e.g. joomla.content.showauthor)
Renvoie
boolean
Depuis
1.0

Références Registry\$data, $n, et $path.

◆ extract()

extract (   $path)

Method to extract a sub-registry from path

Paramètres
string$pathRegistry path (e.g. joomla.content.showauthor)
Renvoie
Registry|null Registry object if data is present
Depuis
1.2.0

Références Registry\$data, $path, et null.

◆ flatten()

flatten (   $separator = null)

Dump to one dimension array.

Paramètres
string$separatorThe key separator.
Renvoie
string[] Dumped array.
Depuis
1.3.0

Références $separator.

◆ get()

get (   $path,
  $default = null 
)

Get a registry value.

Paramètres
string$pathRegistry path (e.g. joomla.content.showauthor)
mixed$defaultOptional default value, returned if the internal value is null.
Renvoie
mixed Value of entry or null
Depuis
1.0

Références Registry\$data, $default, $n, $path, et null.

Référencé par KeychainManager\initPassphraseFile().

◆ getInstance()

static getInstance (   $id)
static

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);
Paramètres
string$idAn ID for the registry instance
Renvoie
Registry The Registry object.
Depuis
1.0
Obsolète:
2.0 Instantiate a new Registry instance instead

Références $id.

◆ getIterator()

getIterator ( )

Gets this object represented as an ArrayIterator.

This allows the data properties to be accessed via a foreach statement.

Renvoie
This object represented as an ArrayIterator.
Voir également
IteratorAggregate::getIterator()
Depuis
1.3.0

◆ jsonSerialize()

jsonSerialize ( )

Implementation for the JsonSerializable interface. Allows us to pass Registry objects to json_encode.

Renvoie
object
Depuis
1.0
Note
The interface is only present in PHP 5.4 and up.

Implémente JsonSerializable.

Références Registry\$data.

◆ loadArray()

loadArray (   $array,
  $flattened = false,
  $separator = null 
)

Load an associative array of values into the default namespace

Paramètres
array$arrayAssociative array of value to load
boolean$flattenedLoad from a one-dimensional array
string$separatorThe key separator
Renvoie
Registry Return this object to support chaining.
Depuis
1.0

Références Registry\$separator, et Registry\bindData().

Référencé par FieldsTableField\bind(), FieldsTableGroup\bind(), FieldsControllerGroup\postSaveHook(), et FieldsControllerField\postSaveHook().

◆ loadFile()

loadFile (   $file,
  $format = 'JSON',
  $options = array() 
)

Load the contents of a file into the registry

Paramètres
string$filePath to file to load
string$formatFormat of the file [optional: defaults to JSON]
array$optionsOptions used by the formatter
Renvoie
Registry Return this object to support chaining.
Depuis
1.0

Références Registry\$data, $file, $format, $options, et Registry\loadString().

◆ loadObject()

loadObject (   $object)

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

Paramètres
object$objectThe object holding the publics to load
Renvoie
Registry Return this object to support chaining.
Depuis
1.0

Références Registry\bindData().

Référencé par Registry\loadString().

◆ loadString()

loadString (   $data,
  $format = 'JSON',
  $options = array() 
)

Load a string into the registry

Paramètres
string$dataString to load into the registry
string$formatFormat of the string
array$optionsOptions used by the formatter
Renvoie
Registry Return this object to support chaining.
Depuis
1.0

Références Registry\$data, $format, $options, AbstractRegistryFormat\getInstance(), et Registry\loadObject().

Référencé par Registry\__construct(), FieldsModelField\getItem(), Registry\loadFile(), ContentModelFeatured\populateState(), ContentModelCategory\populateState(), ContactModelCategory\populateState(), et MenusHtmlMenus\visibility().

◆ merge()

merge (   $source,
  $recursive = false 
)

Merge a Registry object into this one

Paramètres
Registry$sourceSource Registry object to merge.
boolean$recursiveTrue to support recursive merge the children values.
Renvoie
Registry|false Return this object to support chaining or false if $source is not an instance of Registry.
Depuis
1.0

Références Registry\bindData().

Référencé par Registry\__construct().

◆ offsetExists()

offsetExists (   $offset)

Checks whether an offset exists in the iterator.

Paramètres
mixed$offsetThe array offset.
Renvoie
boolean True if the offset exists, false otherwise.
Depuis
1.0

Références $offset, et null.

◆ offsetGet()

offsetGet (   $offset)

Gets an offset in the iterator.

Paramètres
mixed$offsetThe array offset.
Renvoie
mixed The array value if it exists, null otherwise.
Depuis
1.0

Références $offset.

◆ offsetSet()

offsetSet (   $offset,
  $value 
)

Sets an offset in the iterator.

Paramètres
mixed$offsetThe array offset.
mixed$valueThe array value.
Renvoie
void
Depuis
1.0

Références $offset, et $value.

◆ offsetUnset()

offsetUnset (   $offset)

Unsets an offset in the iterator.

Paramètres
mixed$offsetThe array offset.
Renvoie
void
Depuis
1.0

Références $offset.

◆ remove()

remove (   $path)

Delete a registry value

Paramètres
string$pathRegistry Path (e.g. joomla.content.showauthor)
Renvoie
mixed The value of the removed node or null if not set
Depuis
1.6.0

Références $data, $i, $n, $path, et null.

◆ set()

set (   $path,
  $value,
  $separator = null 
)

Set a registry value.

Paramètres
string$pathRegistry Path (e.g. joomla.content.showauthor)
mixed$valueValue of entry
string$separatorThe key separator
Renvoie
mixed The value of the that has been set.
Depuis
1.0

Références Registry\$data, $i, $n, $path, Registry\$separator, et Registry\count().

Référencé par FinderIndexerQuery\__construct(), InstallationModelConfiguration\createConfiguration(), JoomlaupdateModelDefault\download(), InstallerModelDatabase\fixDefaultTextFilters(), UpdateAdapter\getUpdateSiteResponse(), et Update\loadFromXml().

◆ toArray()

toArray ( )

Transforms a namespace to an array

Renvoie
array An associative array holding the namespace data
Depuis
1.0

◆ toFlatten()

toFlatten (   $separator = null,
  $data = null,
$array = array(),
  $prefix = '' 
)
protected

Method to recursively convert data to one dimension array.

Paramètres
string$separatorThe key separator.
array | object$dataData source of this scope.
array$arrayThe result array, it is passed by reference.
string$prefixLast level key prefix.
Renvoie
void
Depuis
1.3.0

Références $data, $key, $prefix, et $separator.

◆ toObject()

toObject ( )

Transforms a namespace to an object

Renvoie
object An an object holding the namespace data
Depuis
1.0

Références $data.

◆ toString()

toString (   $format = 'JSON',
  $options = array() 
)

Get a namespace in a given string format

Paramètres
string$formatFormat to return the string in
mixed$optionsParameters used by the formatter, see formatters for more info
Renvoie
string Namespace in string format
Depuis
1.0

Références $format, et $options.

Référencé par Registry\__toString().

Documentation des champs

◆ $data

◆ $initialized

$initialized = false
protected

◆ $instances

$instances = array()
staticprotected

◆ $separator

$separator = '.'

Référencé par Registry\loadArray(), et Registry\set().


La documentation de cette classe a été générée à partir du fichier suivant :