BookStack\Repos\ChapterRepo::getChildren PHP Метод

getChildren() публичный Метод

Get the child items for a chapter
public getChildren ( Chapter $chapter )
$chapter BookStack\Chapter
    public function getChildren(Chapter $chapter)
    {
        $pages = $this->permissionService->enforcePageRestrictions($chapter->pages())->get();
        // Sort items with drafts first then by priority.
        return $pages->sortBy(function ($child, $key) {
            $score = $child->priority;
            if ($child->draft) {
                $score -= 100;
            }
            return $score;
        });
    }