EpubBook
in package
A parsed EPUB: metadata, spine documents and table-of-contents chapters.
Replaces the Ebook + EpubModule pair previously supplied by
kiwilan/php-ebook, narrowed to the EPUB format and to the members LWT
actually consumes.
Tags
Table of Contents
Properties
- $authors : array<int, string>
- $chapters : array<int, EpubChapter>
- $description : string|null
- $documents : array<int, EpubDocument>
- $language : string|null
- $title : string|null
Methods
- __construct() : mixed
- getAuthorMain() : string|null
- The first `dc:creator` name, or null when the package declares none.
- getAuthors() : array<int, string>
- All `dc:creator` names in document order.
- getChapters() : array<int, EpubChapter>
- Table-of-contents chapters in reading order.
- getDescription() : string|null
- Description from `dc:description`, or null when absent.
- getHtml() : array<int, EpubDocument>
- Spine documents in reading order.
- getLanguage() : string|null
- Language tag from `dc:language`, or null when absent.
- getTitle() : string|null
- Title from `dc:title`, or null when the package declares none.
Properties
$authors
private
array<int, string>
$authors
$chapters
private
array<int, EpubChapter>
$chapters
$description
private
string|null
$description
$documents
private
array<int, EpubDocument>
$documents
$language
private
string|null
$language
$title
private
string|null
$title
Methods
__construct()
public
__construct(string|null $title, array<int, string> $authors, string|null $description, string|null $language, array<int, EpubDocument> $documents, array<int, EpubChapter> $chapters) : mixed
Parameters
- $title : string|null
-
Title from
dc:title - $authors : array<int, string>
-
Names from
dc:creator, document order - $description : string|null
-
Description from
dc:description - $language : string|null
-
Language tag from
dc:language - $documents : array<int, EpubDocument>
-
Spine documents, reading order
- $chapters : array<int, EpubChapter>
-
TOC chapters, reading order
getAuthorMain()
The first `dc:creator` name, or null when the package declares none.
public
getAuthorMain() : string|null
Return values
string|nullgetAuthors()
All `dc:creator` names in document order.
public
getAuthors() : array<int, string>
Return values
array<int, string>getChapters()
Table-of-contents chapters in reading order.
public
getChapters() : array<int, EpubChapter>
Empty when the EPUB ships no usable NCX or EPUB 3 nav document, in which case callers should fall back to getHtml().
Return values
array<int, EpubChapter>getDescription()
Description from `dc:description`, or null when absent.
public
getDescription() : string|null
Return values
string|nullgetHtml()
Spine documents in reading order.
public
getHtml() : array<int, EpubDocument>
Return values
array<int, EpubDocument>getLanguage()
Language tag from `dc:language`, or null when absent.
public
getLanguage() : string|null
Return values
string|nullgetTitle()
Title from `dc:title`, or null when the package declares none.
public
getTitle() : string|null