Upgrade to 3.6.0

This commit is contained in:
Bastian Allgeier
2021-11-16 14:53:37 +01:00
parent 7388fa4d24
commit 92b7a330fa
318 changed files with 20017 additions and 6878 deletions

View File

@@ -19,6 +19,8 @@ class LayoutColumn extends Item
{
const ITEMS_CLASS = '\Kirby\Cms\LayoutColumns';
use HasMethods;
/**
* @var \Kirby\Cms\Blocks
*/
@@ -45,13 +47,33 @@ class LayoutColumn extends Item
$this->width = $params['width'] ?? '1/1';
}
/**
* Magic getter function
*
* @param string $method
* @param mixed $args
* @return mixed
*/
public function __call(string $method, $args)
{
// layout column methods
if ($this->hasMethod($method) === true) {
return $this->callMethod($method, $args);
}
}
/**
* Returns the blocks collection
*
* @param bool $includeHidden Sets whether to include hidden blocks
* @return \Kirby\Cms\Blocks
*/
public function blocks()
public function blocks(bool $includeHidden = false)
{
if ($includeHidden === false) {
return $this->blocks->filter('isHidden', false);
}
return $this->blocks;
}
@@ -104,7 +126,7 @@ class LayoutColumn extends Item
public function toArray(): array
{
return [
'blocks' => $this->blocks()->toArray(),
'blocks' => $this->blocks(true)->toArray(),
'id' => $this->id(),
'width' => $this->width(),
];