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.

Parameters

string $url
int $typeId

Media type ID

int $sampleCount

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.

Parameters

string $attribute
array $value

Return Value

bool

at line 141
string message()

Get the validation error message.

Return Value

string

at line 153
protected string|bool sampleFilesExist(array $files)

Check a random sample of the files for existence.

Parameters

array $files

Return Value

string|bool