mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #7338 from creative-commoners/pulls/4.0/default-array-data-value
MINOR Add default value to ArrayData constructor
This commit is contained in:
commit
3088a76816
@ -29,7 +29,7 @@ class ArrayData extends ViewableData
|
|||||||
* @param object|array $value An associative array, or an object with simple properties.
|
* @param object|array $value An associative array, or an object with simple properties.
|
||||||
* Converts object properties to keys of an associative array.
|
* Converts object properties to keys of an associative array.
|
||||||
*/
|
*/
|
||||||
public function __construct($value)
|
public function __construct($value = [])
|
||||||
{
|
{
|
||||||
if (is_object($value)) {
|
if (is_object($value)) {
|
||||||
$this->array = get_object_vars($value);
|
$this->array = get_object_vars($value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user