PHP Класс BookStack\Repos\ChapterRepo

Наследование: extends EntityRepo
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$pageRepo

Открытые методы

Метод Описание
__construct ( PageRepo $pageRepo ) ChapterRepo constructor.
changeBook ( $bookId, Chapter $chapter, boolean $rebuildPermissions = false ) : Chapter Changes the book relation of this chapter.
createFromInput ( $input, Book $book ) : Chapter Create a new chapter from request input.
destroy ( Chapter $chapter ) Destroy a chapter and its relations by providing its slug.
doesSlugExist ( $slug, $bookId, boolean | false $currentId = false ) : boolean Check if a chapter's slug exists.
findSuitableSlug ( $name, $bookId, boolean | false $currentId = false ) : string Finds a suitable slug for the provided name.
getAll ( ) : Illuminate\Database\Eloquent\Collection | static[] Get all chapters.
getById ( $id ) : mixed Get a chapter by a specific id.
getBySearch ( string $term, array $whereTerms = [], integer $count = 20, array $paginationAppends = [] ) : mixed Get chapters by the given search term.
getBySlug ( $slug, $bookId ) : mixed Get a chapter that has the given slug within the given book.
getChildren ( Chapter $chapter ) Get the child items for a chapter
getNewPriority ( Chapter $chapter ) : integer Get a new priority value for a new page to be added to the given chapter.
idExists ( $id ) : boolean Check if an id exists.

Приватные методы

Метод Описание
chapterQuery ( ) : mixed Base query for getting chapters, Takes permissions into account.

Описание методов

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

ChapterRepo constructor.
public __construct ( PageRepo $pageRepo )
$pageRepo PageRepo

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

Changes the book relation of this chapter.
public changeBook ( $bookId, Chapter $chapter, boolean $rebuildPermissions = false ) : Chapter
$bookId
$chapter BookStack\Chapter
$rebuildPermissions boolean
Результат BookStack\Chapter

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

Create a new chapter from request input.
public createFromInput ( $input, Book $book ) : Chapter
$input
$book BookStack\Book
Результат BookStack\Chapter

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

Destroy a chapter and its relations by providing its slug.
public destroy ( Chapter $chapter )
$chapter BookStack\Chapter

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

Check if a chapter's slug exists.
public doesSlugExist ( $slug, $bookId, boolean | false $currentId = false ) : boolean
$slug
$bookId
$currentId boolean | false
Результат boolean

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

Checks database to prevent duplicate slugs.
public findSuitableSlug ( $name, $bookId, boolean | false $currentId = false ) : string
$name
$bookId
$currentId boolean | false
Результат string

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

Get all chapters.
public getAll ( ) : Illuminate\Database\Eloquent\Collection | static[]
Результат Illuminate\Database\Eloquent\Collection | static[]

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

Get a chapter by a specific id.
public getById ( $id ) : mixed
$id
Результат mixed

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

Get chapters by the given search term.
public getBySearch ( string $term, array $whereTerms = [], integer $count = 20, array $paginationAppends = [] ) : mixed
$term string
$whereTerms array
$count integer
$paginationAppends array
Результат mixed

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

Get a chapter that has the given slug within the given book.
public getBySlug ( $slug, $bookId ) : mixed
$slug
$bookId
Результат mixed

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

Get the child items for a chapter
public getChildren ( Chapter $chapter )
$chapter BookStack\Chapter

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

Get a new priority value for a new page to be added to the given chapter.
public getNewPriority ( Chapter $chapter ) : integer
$chapter BookStack\Chapter
Результат integer

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

Check if an id exists.
public idExists ( $id ) : boolean
$id
Результат boolean

Описание свойств

$pageRepo защищенное свойство

protected $pageRepo