Documentation

GetBookById

Use case for retrieving a single book with its chapters.

Tags
since
3.0.0

Table of Contents

Properties

$bookRepository  : BookRepositoryInterface

Methods

__construct()  : mixed
Constructor.
execute()  : array{book: array{id: int, title: string, author: string|null, description: string|null, languageId: int, sourceType: string, totalChapters: int, currentChapter: int, progress: float, createdAt: string|null, updatedAt: string|null}, chapters: array{id: int, num: int, title: string}[]}|null
Get a book by its ID with chapter list.
getBookContextForText()  : array{bookId: int, bookTitle: string, chapterNum: int, chapterTitle: string|null, totalChapters: int, prevTextId: int|null, nextTextId: int|null, chapters: array{id: int, num: int, title: string}[]}|null
Get book context for a text that belongs to a book.

Properties

Methods

execute()

Get a book by its ID with chapter list.

public execute(int $bookId) : array{book: array{id: int, title: string, author: string|null, description: string|null, languageId: int, sourceType: string, totalChapters: int, currentChapter: int, progress: float, createdAt: string|null, updatedAt: string|null}, chapters: array{id: int, num: int, title: string}[]}|null
Parameters
$bookId : int

Book ID

Return values
array{book: array{id: int, title: string, author: string|null, description: string|null, languageId: int, sourceType: string, totalChapters: int, currentChapter: int, progress: float, createdAt: string|null, updatedAt: string|null}, chapters: array{id: int, num: int, title: string}[]}|null

getBookContextForText()

Get book context for a text that belongs to a book.

public getBookContextForText(int $textId) : array{bookId: int, bookTitle: string, chapterNum: int, chapterTitle: string|null, totalChapters: int, prevTextId: int|null, nextTextId: int|null, chapters: array{id: int, num: int, title: string}[]}|null

This provides the navigation info needed for chapter nav in the reading view.

Parameters
$textId : int

Text ID

Return values
array{bookId: int, bookTitle: string, chapterNum: int, chapterTitle: string|null, totalChapters: int, prevTextId: int|null, nextTextId: int|null, chapters: array{id: int, num: int, title: string}[]}|null

        
On this page

Search results