class CreateNewImagesOrVideos extends Job implements ShouldQueue

Traits

InteractsWithQueue
SerializesModels
Queueable
Dispatchable

Properties

Volume $volume

The volume to create the files for.

array $filenames

The filenames of the files to create.

array $metadata

Metadata of the files to add during creation.

Methods

isFilledString($x)

Determine if a value is not null and not an empty string.

void
__construct(Volume $volume, array $filenames, array $metadata = [])

Create a new job instance.

handle()

Execute the job.

array
createFiles(array $filenames, Collection $metadataMap)

Create an array to be inserted as new image or video models.

Collection
generateImageMetadataMap()

Generate a map for image metadata that is indexed by filename.

Collection
generateVideoMetadataMap()

Generate a map for video metadata that is indexed by filename.

Collection
processVideoColumns(Collection $entries, Collection $columns)

Generate the metadata map entry for a single video file.

Details

isFilledString($x)

Determine if a value is not null and not an empty string.

Parameters

$x

at line 52
void __construct(Volume $volume, array $filenames, array $metadata = [])

Create a new job instance.

Parameters

Volume $volume

The volume to create the files for.

array $filenames

The filenames of the files to create.

array $metadata

File metadata (one row per file plus column headers).

Return Value

void

at line 65
handle()

Execute the job.

Exceptions

QueryException

at line 117
protected array createFiles(array $filenames, Collection $metadataMap)

Create an array to be inserted as new image or video models.

Parameters

array $filenames

New image/video filenames.

Collection $metadataMap

Return Value

array

at line 150
protected Collection generateImageMetadataMap()

Generate a map for image metadata that is indexed by filename.

Return Value

Collection

at line 181
protected Collection generateVideoMetadataMap()

Generate a map for video metadata that is indexed by filename.

Return Value

Collection

at line 219
protected Collection processVideoColumns(Collection $entries, Collection $columns)

Generate the metadata map entry for a single video file.

Parameters

Collection $entries
Collection $columns

Return Value

Collection