Thumbnail
in package
A thumbnail is describing a found embed URL.
Table of Contents
Constants
- ALLOWANCE_NO = 'no'
- ALLOWANCE_PUBLIC = 'public'
- ALLOWANCE_SUGGEST = 'suggest'
Properties
- $allowance : int
- See class constants starting with `ALLOWANCE`.
- $alternativeThumbnail : string
- Alternative thumbnail URLs for `$thumbnailUrl`. If a thumbnail URL does not exist, try another one.
- $blockable : mixed
- $cacheUrl : string
- Cached thumbnail URL.
- $embedUrl : mixed
- $error : string
- Error message.
- $forceRatio : float
- Force ratio by percent.
- $height : int
- Thumbnail height in px.
- $id : mixed
- $md5File : string
- The thumbnail MD5 file checksum. This is needed to differ between multiple downloaded images of the same embed file. E.g. a YouTube preview image to changed.
- $thumbnailUrl : string
- Thumbnail URL.
- $title : string
- Optional title to this thumbnail.
- $width : int
- Thumbnail width in px.
Methods
- __construct() : mixed
- C'tor.
- getAllowance() : mixed
- Getter.
- getAlternativeThumbnailUrl() : mixed
- Getter.
- getBlockable() : mixed
- Getter.
- getCacheUrl() : mixed
- Getter.
- getEmbedUrl() : mixed
- Getter.
- getError() : mixed
- Getter.
- getForceRatio() : mixed
- Getter.
- getHeight() : mixed
- Getter.
- getId() : mixed
- Getter.
- getMd5File() : mixed
- Getter.
- getThumbnailUrl() : mixed
- Getter.
- getTitle() : mixed
- Getter.
- getWidth() : mixed
- Getter.
- isAwaitingThumbnailUrl() : mixed
- Check if this thumbnail is still awaiting another fetch mechanism (e.g. oEmbed or HTML head parser) to obtain the thumbnail URL.
- normalizeEmbedUrl() : mixed
- Normalize some URLs of known cases.
- normalizeTitle() : mixed
- Normalize some titles of known cases.
- setAllowance() : mixed
- Setter.
- setCacheUrl() : mixed
- Setter.
- setError() : mixed
- Setter.
- setForceRatio() : mixed
- Setter.
- setHeight() : mixed
- Setter.
- setMd5File() : mixed
- Setter.
- setThumbnailUrl() : mixed
- Setter.
- setTitle() : mixed
- Setter.
- setWidth() : mixed
- Setter.
Constants
ALLOWANCE_NO
public
mixed
ALLOWANCE_NO
= 'no'
ALLOWANCE_PUBLIC
public
mixed
ALLOWANCE_PUBLIC
= 'public'
ALLOWANCE_SUGGEST
public
mixed
ALLOWANCE_SUGGEST
= 'suggest'
Properties
$allowance
See class constants starting with `ALLOWANCE`.
private
int
$allowance
= self::ALLOWANCE_NO
$alternativeThumbnail
Alternative thumbnail URLs for `$thumbnailUrl`. If a thumbnail URL does not exist, try another one.
private
string
$alternativeThumbnail
$blockable
private
mixed
$blockable
$cacheUrl
Cached thumbnail URL.
private
string
$cacheUrl
$embedUrl
private
mixed
$embedUrl
$error
Error message.
private
string
$error
$forceRatio
Force ratio by percent.
private
float
$forceRatio
$height
Thumbnail height in px.
private
int
$height
$id
private
mixed
$id
$md5File
The thumbnail MD5 file checksum. This is needed to differ between multiple downloaded images of the same embed file. E.g. a YouTube preview image to changed.
private
string
$md5File
$thumbnailUrl
Thumbnail URL.
private
string
$thumbnailUrl
$title
Optional title to this thumbnail.
private
string
$title
$width
Thumbnail width in px.
private
int
$width
Methods
__construct()
C'tor.
public
__construct(string $embedUrl, AbstractBlockable|ImagePreviewBlockable $blockable) : mixed
Parameters
- $embedUrl : string
- $blockable : AbstractBlockable|ImagePreviewBlockable
-
must be a subclass of AbstractBlockable and also implements ImagePreviewBlockable
getAllowance()
Getter.
public
getAllowance() : mixed
Tags
getAlternativeThumbnailUrl()
Getter.
public
getAlternativeThumbnailUrl() : mixed
Tags
getBlockable()
Getter.
public
getBlockable() : mixed
Tags
getCacheUrl()
Getter.
public
getCacheUrl() : mixed
Tags
getEmbedUrl()
Getter.
public
getEmbedUrl() : mixed
Tags
getError()
Getter.
public
getError() : mixed
Tags
getForceRatio()
Getter.
public
getForceRatio() : mixed
Tags
getHeight()
Getter.
public
getHeight() : mixed
Tags
getId()
Getter.
public
getId() : mixed
Tags
getMd5File()
Getter.
public
getMd5File() : mixed
Tags
getThumbnailUrl()
Getter.
public
getThumbnailUrl() : mixed
Tags
getTitle()
Getter.
public
getTitle() : mixed
Tags
getWidth()
Getter.
public
getWidth() : mixed
Tags
isAwaitingThumbnailUrl()
Check if this thumbnail is still awaiting another fetch mechanism (e.g. oEmbed or HTML head parser) to obtain the thumbnail URL.
public
isAwaitingThumbnailUrl() : mixed
normalizeEmbedUrl()
Normalize some URLs of known cases.
public
static normalizeEmbedUrl(string $embedUrl) : mixed
Parameters
- $embedUrl : string
normalizeTitle()
Normalize some titles of known cases.
public
static normalizeTitle(string $title) : mixed
Parameters
- $title : string
setAllowance()
Setter.
public
setAllowance(int $allowance) : mixed
Parameters
- $allowance : int
Tags
setCacheUrl()
Setter.
public
setCacheUrl(string $cacheUrl) : mixed
Parameters
- $cacheUrl : string
Tags
setError()
Setter.
public
setError(string $error) : mixed
Parameters
- $error : string
Tags
setForceRatio()
Setter.
public
setForceRatio(float $ratio) : mixed
Parameters
- $ratio : float
Tags
setHeight()
Setter.
public
setHeight(int $height) : mixed
Parameters
- $height : int
Tags
setMd5File()
Setter.
public
setMd5File(string $md5File) : mixed
Parameters
- $md5File : string
Tags
setThumbnailUrl()
Setter.
public
setThumbnailUrl(string $thumbnailUrl[, string $provider = null ]) : mixed
Parameters
- $thumbnailUrl : string
- $provider : string = null
Tags
setTitle()
Setter.
public
setTitle(string $title) : mixed
Parameters
- $title : string
Tags
setWidth()
Setter.
public
setWidth(int $width) : mixed
Parameters
- $width : int