VolumeFiles
class VolumeFiles implements Rule
Constants
FILENAME_MAX_LENGTH |
Maximum lengths of a volume filename. |
Properties
protected string | $message | The validation message to display. |
|
protected string | $url | The volume URL to check the image files. |
|
protected int | $typeId | The media type ID. |
|
protected int | $sampleCount | Number of sample images to check for existence. |
Methods
__construct(string $url, int $typeId, int $sampleCount = 5)
Create a new instance.
bool
passes(string $attribute, array $value)
Check if an array of image filenames is valid.
string
message()
Get the validation error message.
string|bool
sampleFilesExist(array $files)
Check a random sample of the files for existence.
Details
at line 56
__construct(string $url, int $typeId, int $sampleCount = 5)
Create a new instance.
at line 74
bool
passes(string $attribute, array $value)
Check if an array of image filenames is valid.
A valid array is not empty, contains no duplicates and has only images with JPG, PNG or GIF file endings.
at line 142
string
message()
Get the validation error message.
at line 154
protected string|bool
sampleFilesExist(array $files)
Check a random sample of the files for existence.