AssetProcessingResult
in package
Output of {@see AssetFormatProcessor}: what the processor left on disk.
The processor deliberately does not return an Asset entity: assembly and persistence are shared by
all formats and stay in one place
(AssetProcessingTrait::saveAssetVariants()),
so that Asset columns are not filled in its own way by each format.
Table of Contents
Properties
- $rejected : bool
- $rejectionCode : string|null
- $rejectionReason : string|null
- $thumbnailExtension : string|null
- $thumbnailsGenerated : bool
- $variantDims : array<string|int, mixed>
Methods
- getRejectionCode() : string|null
- Reason code for the user message ({@see UploadRejection} `REASON_*`); `null` on success.
- getRejectionReason() : string|null
- getThumbnailExtension() : string|null
- getVariantDims() : array<string, array{width: int, height: int}>
- isRejected() : bool
- isThumbnailsGenerated() : bool
- rejected() : self
- The file could not be processed (corrupt image, SVG that failed sanitization, ...).
- success() : self
- __construct() : mixed
Properties
$rejected read-only
private
bool
$rejected
$rejectionCode read-only
private
string|null
$rejectionCode
= null
$rejectionReason read-only
private
string|null
$rejectionReason
$thumbnailExtension read-only
private
string|null
$thumbnailExtension
$thumbnailsGenerated read-only
private
bool
$thumbnailsGenerated
$variantDims read-only
private
array<string|int, mixed>
$variantDims
Methods
getRejectionCode()
Reason code for the user message ({@see UploadRejection} `REASON_*`); `null` on success.
public
getRejectionCode() : string|null
getRejectionReason() is the log text.
Return values
string|nullgetRejectionReason()
public
getRejectionReason() : string|null
Return values
string|nullgetThumbnailExtension()
public
getThumbnailExtension() : string|null
Return values
string|nullgetVariantDims()
public
getVariantDims() : array<string, array{width: int, height: int}>
Return values
array<string, array{width: int, height: int}>isRejected()
public
isRejected() : bool
Return values
boolisThumbnailsGenerated()
public
isThumbnailsGenerated() : bool
Return values
boolrejected()
The file could not be processed (corrupt image, SVG that failed sanitization, ...).
public
static rejected(string $reason[, string $code = UploadRejection::REASON_UNREADABLE ]) : self
$code is the code for the user message (UploadRejection), $reason is the log text.
The caller does not create an Asset at all; such input would otherwise abort the whole flush
with a GD exception.
Parameters
- $reason : string
- $code : string = UploadRejection::REASON_UNREADABLE
Return values
selfsuccess()
public
static success(string|null $thumbnailExtension, bool $thumbnailsGenerated, array<string, array{width: int, height: int}> $variantDims) : self
Parameters
- $thumbnailExtension : string|null
-
extension of the generated variants on disk; null = variants not created yet (video without ffmpeg, the catch-up cron fills them in)
- $thumbnailsGenerated : bool
- $variantDims : array<string, array{width: int, height: int}>
-
real dimensions per variant, stored in
Asset.meta
Return values
self__construct()
private
__construct(bool $rejected, string|null $rejectionReason, string|null $thumbnailExtension, bool $thumbnailsGenerated, array<string, array{width: int, height: int}> $variantDims[, string|null $rejectionCode = null ]) : mixed
Parameters
- $rejected : bool
- $rejectionReason : string|null
- $thumbnailExtension : string|null
- $thumbnailsGenerated : bool
- $variantDims : array<string, array{width: int, height: int}>
- $rejectionCode : string|null = null