Created
May 13, 2020 12:16
-
-
Save adrexia/67495f7088cd39470a397105031d4c32 to your computer and use it in GitHub Desktop.
Merge a ViewObject or a ArrayDataObject with a DataList
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$list = SomeObject::get()->toArray(); | |
$singleViewObject = SingleViewObject::create([ | |
'Title' => 'Hello World' | |
]); | |
$result = array_merge($list, [$singleViewObject]); | |
return ArrayList::create($result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment