If $key is an array, the behaviour will be the same as calling the method
multiple times for each (key, value) pair in the $key array.
Note that the parameter $value will not be used if $key is an array.
The $key can also use dot notation in order to set a value deeper inside the Data array.
Works the same way if $addProperty is true, but uses objects instead of arrays.
public setData ( string | array $key, mixed $value = null, mixed $addProperty = false ) : mixed | ||
$key | string | array | The key that identifies the data. |
$value | mixed | The data. Will not be used if $key is an array |
$addProperty | mixed | Whether or not to also set the data as a property of this object. |
return | mixed | The $Value that was set. |