Upgrade to 3.2.5
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace Kirby\Cms;
|
||||
|
||||
use Kirby\Exception\InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* The Structure class wraps
|
||||
* array data into a nicely chainable
|
||||
@@ -18,7 +20,6 @@ namespace Kirby\Cms;
|
||||
*/
|
||||
class Structure extends Collection
|
||||
{
|
||||
|
||||
/**
|
||||
* Creates a new Collection with the given objects
|
||||
*
|
||||
@@ -38,13 +39,17 @@ class Structure extends Collection
|
||||
* StructureObjects
|
||||
*
|
||||
* @param string $id
|
||||
* @param array|StructureObject $object
|
||||
* @param array|StructureObject $props
|
||||
*/
|
||||
public function __set(string $id, $props)
|
||||
{
|
||||
if (is_a($props, StructureObject::class) === true) {
|
||||
if (is_a($props, 'Kirby\Cms\StructureObject') === true) {
|
||||
$object = $props;
|
||||
} else {
|
||||
if (is_array($props) === false) {
|
||||
throw new InvalidArgumentException('Invalid structure data');
|
||||
}
|
||||
|
||||
$object = new StructureObject([
|
||||
'content' => $props,
|
||||
'id' => $props['id'] ?? $id,
|
||||
|
||||
Reference in New Issue
Block a user