Liste de tous les membres
Description détaillée
Définition à la ligne 20 du fichier data.php.
Documentation des constructeurs et destructeur
JData::__construct |
( |
|
$properties = array() | ) |
|
The class constructor.
- Paramètres:
-
mixed | $properties | Either an associative array or another object by which to set the initial properties of the new object. |
- Depuis:
- 12.3
- Exceptions:
-
Définition à la ligne 39 du fichier data.php.
{
if (!empty($properties))
{
$this->
bind($properties);
}
}
Documentation des fonctions membres
JData::__get |
( |
|
$property | ) |
|
The magic get method is used to get a data property.
This method is a public proxy for the protected getProperty method.
Note: Magic __get does not allow recursive calls. This can be tricky because the error generated by recursing into __get is "Undefined property: {CLASS}::{PROPERTY}" which is misleading. This is relevant for this class because requesting a non-visible property can trigger a call to a sub-function. If that references the property directly in the object, it will cause a recursion into __get.
- Paramètres:
-
string | $property | The name of the data property. |
- Renvoie:
- mixed The value of the data property, or null if the data property does not exist.
- Voir également:
- JData::getProperty()
- Depuis:
- 12.3
Définition à la ligne 66 du fichier data.php.
JData::__isset |
( |
|
$property | ) |
|
The magic isset method is used to check the state of an object property.
- Paramètres:
-
string | $property | The name of the data property. |
- Renvoie:
- boolean True if set, otherwise false is returned.
- Depuis:
- 12.3
Définition à la ligne 80 du fichier data.php.
{
return isset($this->_properties[$property]);
}
JData::__set |
( |
|
$property, |
|
|
|
$value |
|
) |
| |
The magic set method is used to set a data property.
This is a public proxy for the protected setProperty method.
- Paramètres:
-
string | $property | The name of the data property. |
mixed | $value | The value to give the data property. |
- Renvoie:
- void
- Voir également:
- JData::setProperty()
- Depuis:
- 12.3
Définition à la ligne 98 du fichier data.php.
JData::__unset |
( |
|
$property | ) |
|
The magic unset method is used to unset a data property.
- Paramètres:
-
string | $property | The name of the data property. |
- Renvoie:
- void
- Depuis:
- 12.3
Définition à la ligne 112 du fichier data.php.
{
unset($this->_properties[$property]);
}
JData::bind |
( |
|
$properties, |
|
|
|
$updateNulls = true |
|
) |
| |
Binds an array or object to this object.
- Paramètres:
-
mixed | $properties | An associative array of properties or an object. |
boolean | $updateNulls | True to bind null values, false to ignore null values. |
- Renvoie:
- JData Returns itself to allow chaining.
- Depuis:
- 12.3
- Exceptions:
-
Définition à la ligne 128 du fichier data.php.
{
if (!is_array($properties) && !is_object($properties))
{
throw new InvalidArgumentException(sprintf('%s(%s)', __METHOD__, gettype($properties)));
}
if ($properties instanceof Traversable)
{
$properties = iterator_to_array($properties);
}
elseif (is_object($properties))
{
$properties = (array) $properties;
}
foreach ($properties as $property => $value)
{
if ($value === null && !$updateNulls)
{
continue;
}
}
return $this;
}
Count the number of data properties.
- Renvoie:
- integer The number of data properties.
- Depuis:
- 12.3
Définition à la ligne 328 du fichier data.php.
{
return count($this->_properties);
}
JData::dump |
( |
|
$depth = 3 , |
|
|
SplObjectStorage |
$dumped = null |
|
) |
| |
Dumps the data properties into a stdClass object, recursively if appropriate.
- Paramètres:
-
integer | $depth | The maximum depth of recursion (default = 3). For example, a depth of 0 will return a stdClass with all the properties in native form. A depth of 1 will recurse into the first level of properties only. |
SplObjectStorage | $dumped | An array of already serialized objects that is used to avoid infinite loops. |
- Renvoie:
- stdClass The data properties as a simple PHP stdClass object.
- Depuis:
- 12.3
Implémente JDataDumpable.
Définition à la ligne 177 du fichier data.php.
{
if ($dumped === null)
{
$dumped = new SplObjectStorage;
}
$dumped->attach($this);
$dump = new stdClass;
foreach (array_keys($this->_properties) as $property)
{
$dump->$property = $this->
dumpProperty($property, $depth, $dumped);
}
return $dump;
}
JData::dumpProperty |
( |
|
$property, |
|
|
|
$depth, |
|
|
SplObjectStorage |
$dumped |
|
) |
| |
|
protected |
Dumps a data property.
If recursion is set, this method will dump any object implementing JDumpable (like JData and JDataSet); it will convert a JDate object to a string; and it will convert a JRegistry to an object.
- Paramètres:
-
string | $property | The name of the data property. |
integer | $depth | The current depth of recursion (a value of 0 will ignore recursion). |
SplObjectStorage | $dumped | An array of already serialized objects that is used to avoid infinite loops. |
- Renvoie:
- mixed The value of the dumped property.
- Depuis:
- 12.3
Définition à la ligne 242 du fichier data.php.
{
if ($depth > 0)
{
{
if (!$dumped->contains($value))
{
$value = $value->dump($depth - 1, $dumped);
}
}
if ($value instanceof
JDate)
{
$value = (string) $value;
}
{
$value = $value->toObject();
}
}
return $value;
}
Gets this object represented as an ArrayIterator.
This allows the data properties to be access via a foreach statement.
- Renvoie:
- ArrayIterator This object represented as an ArrayIterator.
- Voir également:
- IteratorAggregate::getIterator()
- Depuis:
- 12.3
Définition à la ligne 211 du fichier data.php.
{
return new ArrayIterator($this->
dump(0));
}
JData::getProperty |
( |
|
$property | ) |
|
|
protected |
Gets a data property.
- Paramètres:
-
string | $property | The name of the data property. |
- Renvoie:
- mixed The value of the data property.
- Voir également:
- JData::__get()
- Depuis:
- 12.3
Définition à la ligne 283 du fichier data.php.
{
$value = array_key_exists($property, $this->_properties) ? $this->_properties[$property] : null;
return $value;
}
Gets the data properties in a form that can be serialised to JSON format.
- Renvoie:
- string An object that can be serialised by json_encode().
- Depuis:
- 12.3
Implémente JsonSerializable.
Définition à la ligne 223 du fichier data.php.
JData::setProperty |
( |
|
$property, |
|
|
|
$value |
|
) |
| |
|
protected |
Sets a data property.
If the name of the property starts with a null byte, this method will return null.
- Paramètres:
-
string | $property | The name of the data property. |
mixed | $value | The value to give the data property. |
- Renvoie:
- mixed The value of the data property.
- Voir également:
- JData::__set()
- Depuis:
- 12.3
Définition à la ligne 304 du fichier data.php.
{
if (strpos($property, "\0") === 0)
{
return null;
}
$this->_properties[$property] = $value;
return $value;
}
Documentation des données membres
JData::$_properties = array() |
|
private |
La documentation de cette classe a été générée à partir du fichier suivant :