class Volume extends Model

A volume is a collection of images. Volumes belong to one or many projects.

Traits

Constants

IMAGE_FILE_REGEX

Regular expression that matches the supported image file extensions.

This regex allows optional HTTP query parameters after the file names, too. Example "image.jpg?raw=1". This may be required for remote images with services like Dropbox.

VIDEO_FILE_REGEX

Regular expression that matches the supported video file extensions.

This regex allows optional HTTP query parameters after the file names, too. Example "video.mp4?raw=1". This may be required for remote files with services like Dropbox.

Properties

MediaType $media_type

Methods

setJsonAttr(string $key, mixed $value, string $attrs = 'attrs')

Set a dynamic JSON attribute.

mixed
getJsonAttr(string $key, mixed $default = null, string $attrs = 'attrs')

Get a dynamic JSON attribute.

string
getMetadataFileDisk()

{@inheritdoc}

bool
hasMetadata()

No description

void
saveMetadata(UploadedFile $file)

No description

getMetadata()

No description

void
deleteMetadata(bool $noUpdate = false)

No description

array
casts()

Get the attributes that should be cast.

static array
parseFilesQueryString(string $string)

Parses a comma separated list of filenames to an array.

Builder
scopeAccessibleBy(Builder $query, User $user)

Scope a query to all volumes that are accessible by a user.

User, $this>
creator()

The user that created the volume.

Image, $this>
images()

The images belonging to this volume.

Video, $this>
videos()

The videos belonging to this volume.

VolumeFile, $this>
files()

The images or videos belonging to this volume.

VolumeFile, $this>
orderedImages() deprecated

The images belonging to this volume ordered by filename (ascending).

VolumeFile, $this>
orderedFiles()

The images belonging to this volume ordered by filename (ascending).

Builder
users()

Return a query for all users associated to this volume through projects.

Project, $this>
projects()

The project(s), this volume belongs to.

AnnotationSession, $this>
annotationSessions()

The annotation sessions of this volume.

AnnotationSession, $this>
activeAnnotationSession()

The active annotation sessions of this volume (if any).

getActiveAnnotationSession(User $user)

Returns the active annotation session of this volume for the given user.

bool
hasConflictingAnnotationSession(AnnotationSession $session)

Check if the given annotation session is in conflict with existing ones.

bool
isRemote()

Check if the images of this volume come from a remote URL.

Image|null
getThumbnailAttribute()

An image that can be used as unique thumbnail for this volume.

string|null
getThumbnailUrlAttribute()

URL to the thumbnail image of this volume.

Collection
getThumbnailsAttribute()

Several images or videos that can be used for the preview thumbnail of a volume.

Collection
getThumbnailsUrlAttribute()

URLs to the thumbnail images of this volume.

flushThumbnailCache()

Flush the cache that stores the volume thumbnail.

bool
hasGeoInfo()

Check if the volume has some images with GPS coordinates.

flushGeoInfoCache()

Flush the cached information if this volume has images with GPS coordinates.

setUrlAttribute(string|null $value)

Set the url attribute of this volume.

setCreatingAsyncAttribute(bool $value)

Set the creating_async attribute of this volume.

bool
getCreatingAsyncAttribute()

Get the creating_async attribute of this volume.

?array
getExportAreaAttribute()

Return the dynamic attribute for the export area.

setExportAreaAttribute(array|null $value)

Set or update the dynamic attribute for the export area.

bool
hasTiledImages()

Check if the there are tiled images in this volume.

bool
isImageVolume()

Specifies whether the volume is an image volume.

bool
isVideoVolume()

Specifies whether the volume is a video volume.

string
getThumbnailsCacheKey()

Get the cache key for volume thumbnails.

string
getGeoInfoCacheKey()

Get the cache key for volume geo info.

Details

in HasJsonAttributes at line 16
protected setJsonAttr(string $key, mixed $value, string $attrs = 'attrs')

Set a dynamic JSON attribute.

Parameters

string $key

Key of the attribute in the JSON.

mixed $value

Value of the attribute in the JSON.

string $attrs

Name of the JSON column of the model.

in HasJsonAttributes at line 38
protected mixed getJsonAttr(string $key, mixed $default = null, string $attrs = 'attrs')

Get a dynamic JSON attribute.

Parameters

string $key

Key of the attribute in the JSON.

mixed $default

Default value.

string $attrs

Name of the JSON column of the model.

Return Value

mixed

at line 477
string getMetadataFileDisk()

{@inheritdoc}

Return Value

string

in HasMetadataFile at line 20
bool hasMetadata()

No description

Return Value

bool

in HasMetadataFile at line 25
void saveMetadata(UploadedFile $file)

No description

Parameters

UploadedFile $file

Return Value

void

in HasMetadataFile at line 35
VolumeMetadata|null getMetadata()

No description

Return Value

VolumeMetadata|null

in HasMetadataFile at line 67
void deleteMetadata(bool $noUpdate = false)

No description

Parameters

bool $noUpdate

Do not set metadata_file_path to null.

Return Value

void

at line 56
protected array casts()

Get the attributes that should be cast.

Return Value

array

at line 71
static array parseFilesQueryString(string $string)

Parses a comma separated list of filenames to an array.

Parameters

string $string

Return Value

array

at line 85
Builder scopeAccessibleBy(Builder $query, User $user)

Scope a query to all volumes that are accessible by a user.

Parameters

Builder $query
User $user

Return Value

Builder

at line 103
User, $this> creator()

The user that created the volume.

Return Value

User, $this>

at line 113
Image, $this> images()

The images belonging to this volume.

Return Value

Image, $this>

at line 123
Video, $this> videos()

The videos belonging to this volume.

Return Value

Video, $this>

at line 133
VolumeFile, $this> files()

The images or videos belonging to this volume.

Return Value

VolumeFile, $this>

at line 148
VolumeFile, $this> orderedImages() deprecated

deprecated Use `orderedFiles` instead.

The images belonging to this volume ordered by filename (ascending).

Return Value

VolumeFile, $this>

at line 158
VolumeFile, $this> orderedFiles()

The images belonging to this volume ordered by filename (ascending).

Return Value

VolumeFile, $this>

at line 168
Builder users()

Return a query for all users associated to this volume through projects.

Return Value

Builder

at line 187
Project, $this> projects()

The project(s), this volume belongs to.

Return Value

Project, $this>

at line 197
AnnotationSession, $this> annotationSessions()

The annotation sessions of this volume.

Return Value

AnnotationSession, $this>

at line 207
AnnotationSession, $this> activeAnnotationSession()

The active annotation sessions of this volume (if any).

Return Value

AnnotationSession, $this>

at line 227
AnnotationSession|null getActiveAnnotationSession(User $user)

Returns the active annotation session of this volume for the given user.

An annotation session may be active for a volume but it is only also active for a user, if the user belongs to the set of restricted users of the annotation session.

Parameters

User $user

Return Value

AnnotationSession|null

at line 247
bool hasConflictingAnnotationSession(AnnotationSession $session)

Check if the given annotation session is in conflict with existing ones.

A conflict exists if the active time period of two sessions overlaps.

Parameters

AnnotationSession $session

The annotation session to check

Return Value

bool

at line 274
bool isRemote()

Check if the images of this volume come from a remote URL.

Return Value

bool

at line 284
Image|null getThumbnailAttribute()

An image that can be used as unique thumbnail for this volume.

Return Value

Image|null

at line 296
string|null getThumbnailUrlAttribute()

URL to the thumbnail image of this volume.

Return Value

string|null

at line 306
Collection getThumbnailsAttribute()

Several images or videos that can be used for the preview thumbnail of a volume.

Return Value

Collection

at line 344
Collection getThumbnailsUrlAttribute()

URLs to the thumbnail images of this volume.

Return Value

Collection

at line 352
flushThumbnailCache()

Flush the cache that stores the volume thumbnail.

at line 362
bool hasGeoInfo()

Check if the volume has some images with GPS coordinates.

Return Value

bool

at line 370
flushGeoInfoCache()

Flush the cached information if this volume has images with GPS coordinates.

at line 381
setUrlAttribute(string|null $value)

Set the url attribute of this volume.

Parameters

string|null $value

at line 396
setCreatingAsyncAttribute(bool $value)

Set the creating_async attribute of this volume.

Parameters

bool $value

at line 408
bool getCreatingAsyncAttribute()

Get the creating_async attribute of this volume.

Return Value

bool

at line 418
?array getExportAreaAttribute()

Return the dynamic attribute for the export area.

Return Value

?array

at line 426
setExportAreaAttribute(array|null $value)

Set or update the dynamic attribute for the export area.

Parameters

array|null $value

at line 448
bool hasTiledImages()

Check if the there are tiled images in this volume.

Return Value

bool

at line 459
bool isImageVolume()

Specifies whether the volume is an image volume.

Return Value

bool

at line 469
bool isVideoVolume()

Specifies whether the volume is a video volume.

Return Value

bool

at line 487
protected string getThumbnailsCacheKey()

Get the cache key for volume thumbnails.

Return Value

string

at line 497
protected string getGeoInfoCacheKey()

Get the cache key for volume geo info.

Return Value

string