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

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

Check if a chapter's slug exists.
public doesSlugExist ( $slug, $bookId, boolean | false $currentId = false ) : boolean
$slug
$bookId
$currentId boolean | false
Результат boolean
    public function doesSlugExist($slug, $bookId, $currentId = false)
    {
        $query = $this->chapter->where('slug', '=', $slug)->where('book_id', '=', $bookId);
        if ($currentId) {
            $query = $query->where('id', '!=', $currentId);
        }
        return $query->count() > 0;
    }