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é
|
Fonctions membres publiques | |
__construct (array $objects=array()) | |
__call ($method, $arguments=array()) | |
__get ($property) | |
__isset ($property) | |
__set ($property, $value) | |
__unset ($property) | |
getObjectsKeys ($type='all') | |
toArray ($associative=true, $k=null) | |
count () | |
clear () | |
current () | |
dump ($depth=3, \SplObjectStorage $dumped=null) | |
jsonSerialize ($serialized=null) | |
key () | |
keys () | |
walk ($funcname) | |
next () | |
offsetExists ($offset) | |
offsetGet ($offset) | |
offsetSet ($offset, $object) | |
offsetUnset ($offset) | |
rewind () | |
valid () | |
Fonctions membres privées | |
_initialise (array $input=array()) | |
Attributs privés | |
$current = false | |
$objects = array() | |
DataSet is a collection class that allows the developer to operate on a set of DataObject objects as if they were in a typical PHP array.
__construct | ( | array | $objects = array() | ) |
The class constructor.
DataObject[] | $objects An array of DataObject objects to bind to the data set. |
Références DataSet\$objects, et DataSet\_initialise().
__call | ( | $method, | |
$arguments = array() |
|||
) |
The magic call method is used to call object methods using the iterator.
Example: $array = $objectList->foo('bar');
The object list will iterate over its objects and see if each object has a callable 'foo' method. If so, it will pass the argument list and assemble any return values. If an object does not have a callable method no return value is recorded. The keys of the objects and the result array are maintained.
string | $method | The name of the method called. |
array | $arguments | The arguments of the method called. |
__get | ( | $property | ) |
The magic get method is used to get a list of properties from the objects in the data set.
Example: $array = $dataSet->foo;
This will return a column of the values of the 'foo' property in all the objects (or values determined by custom property setters in the individual Data's). The result array will contain an entry for each object in the list (compared to __call which may not). The keys of the objects and the result array are maintained.
string | $property | The name of the data property. |
__isset | ( | $property | ) |
The magic isset method is used to check the state of an object property using the iterator.
Example: $array = isset($objectList->foo);
string | $property | The name of the property. |
__set | ( | $property, | |
$value | |||
) |
The magic set method is used to set an object property using the iterator.
Example: $objectList->foo = 'bar';
This will set the 'foo' property to 'bar' in all of the objects (or a value determined by custom property setters in the Data).
string | $property | The name of the property. |
mixed | $value | The value to give the data property. |
Références $value.
__unset | ( | $property | ) |
The magic unset method is used to unset an object property using the iterator.
Example: unset($objectList->foo);
This will unset all of the 'foo' properties in the list of Data's.
string | $property | The name of the property. |
|
private |
Initialises the list with an array of objects.
array | $input | An array of objects. |
Références $input, $key, DataSet\offsetSet(), et DataSet\rewind().
Référencé par DataSet\__construct().
clear | ( | ) |
Clears the objects in the data set.
Références DataSet\rewind().
count | ( | ) |
Gets the number of data objects in the set.
current | ( | ) |
Get the current data object in the set.
Références DataSet\$current.
Référencé par DataSet\next(), DataSet\offsetUnset(), DataSet\rewind(), et DataSet\valid().
dump | ( | $depth = 3 , |
|
\SplObjectStorage | $dumped = null |
||
) |
Dumps the data object in the set, recursively if appropriate.
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. |
Implémente DumpableInterface.
Références $key, DataSet\$objects, et null.
getObjectsKeys | ( | $type = 'all' | ) |
Gets an array of keys, existing in objects
string | $type | Selection type 'all' or 'common' |
Références $function, $type, elseif, json_encode, et null.
Référencé par DataSet\toArray().
jsonSerialize | ( | $serialized = null | ) |
Gets the data set in a form that can be serialised to JSON format.
Note that this method will not return an associative array, otherwise it would be encoded into an object. JSON decoders do not consistently maintain the order of associative keys, whereas they do maintain the order of arrays.
mixed | $serialized | An array of objects that have already been serialized that is used to infinite loops (null on first call). |
key | ( | ) |
Gets the key of the current object in the iterator.
Références DataSet\$current.
keys | ( | ) |
Gets the array of keys for all the objects in the iterator (emulates array_keys).
Référencé par DataSet\next(), DataSet\offsetUnset(), et DataSet\rewind().
next | ( | ) |
Advances the iterator to the next object in the iterator.
Références $position, DataSet\current(), DataSet\keys(), et null.
offsetExists | ( | $offset | ) |
Checks whether an offset exists in the iterator.
mixed | $offset | The object offset. |
Références $offset.
Référencé par DataSet\offsetUnset().
offsetGet | ( | $offset | ) |
Gets an offset in the iterator.
mixed | $offset | The object offset. |
offsetSet | ( | $offset, | |
$object | |||
) |
Sets an offset in the iterator.
mixed | $offset | The object offset. |
DataObject | $object | The object object. |
Références $offset.
Référencé par DataSet\_initialise().
offsetUnset | ( | $offset | ) |
Unsets an offset in the iterator.
mixed | $offset | The object offset. |
Références $offset, $position, DataSet\current(), DataSet\keys(), et DataSet\offsetExists().
rewind | ( | ) |
Rewinds the iterator to the first object.
Références DataSet\current(), et DataSet\keys().
Référencé par DataSet\_initialise(), et DataSet\clear().
Gets all objects as an array
boolean | $associative | Option to set return mode: associative or numeric array. |
string | $k | Unlimited optional property names to extract from objects. |
Références $i, $key, $return, DataSet\getObjectsKeys(), et null.
valid | ( | ) |
Validates the iterator.
Références DataSet\current().
walk | ( | $funcname | ) |
Référencé par DataSet\current(), et DataSet\key().
|
private |
Référencé par DataSet\__construct(), et DataSet\dump().