BookStack\Services\PermissionService::getChapter PHP Метод

getChapter() защищенный Метод

Get a chapter via ID, Checks local cache
protected getChapter ( $chapterId ) : Book
$chapterId
Результат BookStack\Book
    protected function getChapter($chapterId)
    {
        if (isset($this->entityCache['chapters']) && $this->entityCache['chapters']->has($chapterId)) {
            return $this->entityCache['chapters']->get($chapterId);
        }
        $chapter = $this->chapter->find($chapterId);
        if ($chapter === null) {
            $chapter = false;
        }
        if (isset($this->entityCache['chapters'])) {
            $this->entityCache['chapters']->put($chapterId, $chapter);
        }
        return $chapter;
    }