Item
An item of the EPUB manifest.
- Full name:
\SebLucas\EPubMeta\Data\Item
Constants
Constant | Visibility | Type | Value |
---|---|---|---|
XHTML |
public | 'application/xhtml+xml' |
Properties
id
href
mediaType
dataCallable
data
size
Methods
__construct
public __construct(string $id, string $href, callable $dataCallable, int $size, string|null $mediaType = null): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$id |
string | This Item’s identifier. |
$href |
string | The path to the corresponding file. |
$dataCallable |
callable | A callable to get data from the referenced file. |
$size |
int | The size of the referenced file. |
$mediaType |
string|null | The media type of the corresponding file. If omitted XHTML is assumed. |
getId
getHref
getMediaType
getContents
Extract (a part of) the contents from the referenced XML file.
public getContents(string|null $fragmentBegin = null, string|null $fragmentEnd = null, bool $keepMarkup = false): string
Parameters:
Parameter | Type | Description |
---|---|---|
$fragmentBegin |
string|null | ID of the element where to start reading the contents. |
$fragmentEnd |
string|null | ID of the element where to stop reading the contents. |
$keepMarkup |
bool | Whether to keep the XHTML markup rather than extracted plain text. |
Return Value:
The contents of that fragment.
Throws:
getData
Get the file data.
Return Value:
The binary data of the corresponding file.
getSize
Get the size of the corresponding file.
Automatically generated on 2025-03-18