Upgrade to 3.2.5

This commit is contained in:
Bastian Allgeier
2019-09-24 11:00:59 +02:00
parent ff9b5b1861
commit 447a9dd266
234 changed files with 1990 additions and 1224 deletions

View File

@@ -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,