update kirby
This commit is contained in:
parent
652262ac94
commit
9c662bcbba
165 changed files with 1757 additions and 598 deletions
|
|
@ -61,19 +61,19 @@ class Pages extends Collection
|
|||
if ($object instanceof self) {
|
||||
$this->data = array_merge($this->data, $object->data);
|
||||
|
||||
// add a page by id
|
||||
// add a page by id
|
||||
} elseif (
|
||||
is_string($object) === true &&
|
||||
$page = $site->find($object)
|
||||
) {
|
||||
$this->__set($page->id(), $page);
|
||||
|
||||
// add a page object
|
||||
// add a page object
|
||||
} elseif ($object instanceof Page) {
|
||||
$this->__set($object->id(), $object);
|
||||
|
||||
// give a useful error message on invalid input;
|
||||
// silently ignore "empty" values for compatibility with existing setups
|
||||
// give a useful error message on invalid input;
|
||||
// silently ignore "empty" values for compatibility with existing setups
|
||||
} elseif (in_array($object, [null, false, true], true) !== true) {
|
||||
throw new InvalidArgumentException('You must pass a Pages or Page object or an ID of an existing page to the Pages collection');
|
||||
}
|
||||
|
|
@ -142,8 +142,8 @@ class Pages extends Collection
|
|||
*/
|
||||
public static function factory(
|
||||
array $pages,
|
||||
Page|Site $model = null,
|
||||
bool $draft = null
|
||||
Page|Site|null $model = null,
|
||||
bool|null $draft = null
|
||||
): static {
|
||||
$model ??= App::instance()->site();
|
||||
$children = new static([], $model);
|
||||
|
|
@ -248,7 +248,7 @@ class Pages extends Collection
|
|||
*/
|
||||
protected function findByKeyRecursive(
|
||||
string $id,
|
||||
string $startAt = null,
|
||||
string|null $startAt = null,
|
||||
bool $multiLang = false
|
||||
) {
|
||||
$path = explode('/', $id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue