diff --git a/core/src/Controllers/MoveDocument.php b/core/src/Controllers/MoveDocument.php index a49893b500..63aebcd48a 100644 --- a/core/src/Controllers/MoveDocument.php +++ b/core/src/Controllers/MoveDocument.php @@ -88,7 +88,7 @@ protected function handle() $parentDocument->isfolder = true; $parentDocument->save(); - if ($document->ancestor && $document->ancestor->childrens()->count() <= 1) { + if ($document->ancestor && $document->ancestor->children()->count() <= 1) { $document->ancestor->isfolder = false; $document->ancestor->save(); } diff --git a/core/src/Models/SiteContent.php b/core/src/Models/SiteContent.php index e2e4931d4c..c35cf93a2e 100644 --- a/core/src/Models/SiteContent.php +++ b/core/src/Models/SiteContent.php @@ -50,7 +50,7 @@ * @property SiteTemplate|null $tpl * * HasMany - * @property Eloquent\Collection $childrens + * @property Eloquent\Collection $children * @property Eloquent\Collection $templateValues * * BelongsToMany @@ -267,12 +267,12 @@ public function getAlreadyEditInfoAttribute(): ?array /** * @return array */ - public function getAllChildrens($parent): array + public function getAllChildren($parent): array { $ids = []; - foreach ($parent->childrens as $child) { + foreach ($parent->children as $child) { $ids[] = $child->id; - $ids = array_merge($ids, $this->getAllChildrens($child)); + $ids = array_merge($ids, $this->getAllChildren($child)); } return $ids; } @@ -344,7 +344,7 @@ public function ancestor(): Eloquent\Relations\BelongsTo /** * @return Eloquent\Relations\HasMany */ - public function childrens(): Eloquent\Relations\HasMany + public function children(): Eloquent\Relations\HasMany { return $this->hasMany(__CLASS__, 'parent') ->withTrashed(); diff --git a/manager/processors/delete_content.processor.php b/manager/processors/delete_content.processor.php index 3599b20d1e..1c79003608 100755 --- a/manager/processors/delete_content.processor.php +++ b/manager/processors/delete_content.processor.php @@ -33,7 +33,7 @@ $modx->webAlertAndQuit($_lang["access_permission_denied"]); } -$children = $document->getAllChildrens($document); +$children = $document->getAllChildren($document); // invoke OnBeforeDocFormDelete event $modx->invokeEvent("OnBeforeDocFormDelete", diff --git a/manager/processors/undelete_content.processor.php b/manager/processors/undelete_content.processor.php index f853c5f988..2807ed6a59 100755 --- a/manager/processors/undelete_content.processor.php +++ b/manager/processors/undelete_content.processor.php @@ -35,7 +35,7 @@ $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!"); } -$children = $document->getAllChildrens($document); +$children = $document->getAllChildren($document); $documentDeleteIds = $children; array_unshift($documentDeleteIds, $id);