|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
| convertDataToArray ($data) | |
| toOptionArray (array $items, $idField, $valueField) | |
| toOptionHash (array $items, $idField, $valueField) | |
Data Fields | |
| const | CYCLE_DETECTED_MARK = '*** CYCLE DETECTED ***' |
Protected Member Functions | |
| _convertObjectToArray ($obj, &$objects=[]) | |
| _invokeGetter ($item, $field) | |
Definition at line 14 of file DataObject.php.
|
protected |
Converts a \Magento\Framework\DataObject into an array, including any children objects
| mixed | $obj | array or object to convert |
| array | $objects | array of object hashes used for cycle detection |
Definition at line 46 of file DataObject.php.
|
protected |
Returns the value of the property represented by $field on the $item object.
When $field is a closure, the $item parameter is passed to the $field method, otherwise the $field is assumed to be a property name, and the associated get method is invoked on the $item instead.
| mixed | $item | |
| string | callable | $field |
Definition at line 133 of file DataObject.php.
| convertDataToArray | ( | $data | ) |
Convert input data into an array and return the resulting array. The resulting array should not contain any objects.
| array | $data | input data |
Definition at line 26 of file DataObject.php.
| toOptionArray | ( | array | $items, |
| $idField, | |||
| $valueField | |||
| ) |
Converts the list of objects into an array of the form: [ [ 'label' => <id>, 'value' =>
], ... ].
The <id> and
values are taken from the objects in the list using the $idField and $valueField parameters, which can be either the name of the field to use, or a closure.
| array | $items | |
| string | callable | $idField | |
| string | callable | $valueField |
Definition at line 89 of file DataObject.php.
| toOptionHash | ( | array | $items, |
| $idField, | |||
| $valueField | |||
| ) |
Converts the list of objects into an array of the form: [ <id> =>
, ... ].
The <id> and
values are taken from the objects in the list using the $idField and $valueField parameters, which can be either the name of the field to use, or a closure.
| array | $items | |
| string | callable | $idField | |
| string | callable | $valueField |
Definition at line 113 of file DataObject.php.
| const CYCLE_DETECTED_MARK = '*** CYCLE DETECTED ***' |
Constant used to mark cycles in the input array/objects
Definition at line 17 of file DataObject.php.