class Volume extends Volume

Extends the base Biigle volume.

Traits

HasFactory

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.

EXPORT_AREA_ATTRIBUTE

Name of the attribute that stores export area rectangle for the volume.

Properties

protected array $hidden

The attributes hidden from the model's JSON form.

from  Volume
protected array $casts

The attributes that should be casted to native types.

from  Volume

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.

static array
parseFilesQueryString(string $string)

Parses a comma separated list of filenames to an array.

from  Volume
Builder
scopeAccessibleBy(Builder $query, User $user)

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

from  Volume
BelongsTo
creator()

The user that created the volume.

from  Volume
BelongsTo
mediaType()

The media type of this volume.

from  Volume
HasMany
images()

The images belonging to this volume.

from  Volume
HasMany
videos()

The videos belonging to this volume.

from  Volume
HasMany
files()

The images or videos belonging to this volume.

from  Volume
HasMany
orderedImages() deprecated

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

from  Volume
HasMany
orderedFiles()

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

from  Volume
Builder
users()

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

from  Volume
BelongsToMany
projects()

The project(s), this volume belongs to.

from  Volume
HasMany
annotationSessions()

The annotation sessions of this volume.

from  Volume
HasOne
activeAnnotationSession()

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

from  Volume
getActiveAnnotationSession(User $user)

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

from  Volume
bool
hasConflictingAnnotationSession(AnnotationSession $session)

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

from  Volume
bool
isRemote()

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

from  Volume
getThumbnailAttribute()

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

from  Volume
string
getThumbnailUrlAttribute()

URL to the thumbnail image of this volume.

from  Volume
Collection
getThumbnailsAttribute()

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

from  Volume
array
getThumbnailsUrlAttribute()

URLs to the thumbnail images of this volume.

from  Volume
flushThumbnailCache()

Flush the cache that stores the volume thumbnail.

from  Volume
bool
hasGeoInfo()

Check if the volume has some images with GPS coordinates.

from  Volume
flushGeoInfoCache()

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

from  Volume
setUrlAttribute(string $value)

Set the url attribute of this volume.

from  Volume
setCreatingAsyncAttribute(string $value)

Set the creating_async attribute of this volume.

from  Volume
string
getCreatingAsyncAttribute()

Get the creating_async attribute of this volume.

from  Volume
bool
hasTiledImages()

Check if the there are tiled images in this volume.

from  Volume
bool
isImageVolume()

Specifies whether the volume is an image volume.

from  Volume
bool
isVideoVolume()

Specifies whether the volume is a video volume.

from  Volume
saveIfdo(UploadedFile $file)

Save an iFDO metadata file and link it with this volume.

from  Volume
bool
hasIfdo(bool $ignoreErrors = false)

Check if an iFDO metadata file is available for this volume.

from  Volume
deleteIfdo()

Delete the iFDO metadata file linked with this volume.

from  Volume
Response
downloadIfdo()

Download the iFDO that is attached to this volume.

from  Volume
array
getIfdo()

Get the content of the iFDO file associated with this volume.

from  Volume
string
getIfdoFilename()

Get the filename of the volume iFDO in storage.

from  Volume
string
getThumbnailsCacheKey()

Get the cache key for volume thumbnails.

from  Volume
string
getGeoInfoCacheKey()

Get the cache key for volume geo info.

from  Volume
string
getIfdoCacheKey()

Get the cache key for volume iFDO info.

from  Volume
static Volume
convert(Volume $volume)

Converts a regular Biigle volume to an export volume.

array
getExportAreaAttribute()

Return the dynamic attribute for the export area.

setExportAreaAttribute(array $value)

Set or update the dynamic attribute for the export area.

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

in Volume at line 71
static array parseFilesQueryString(string $string)

Parses a comma separated list of filenames to an array.

Parameters

string $string

Return Value

array

in Volume 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

in Volume at line 105
BelongsTo creator()

The user that created the volume.

Return Value

BelongsTo

in Volume at line 115
BelongsTo mediaType()

The media type of this volume.

Return Value

BelongsTo

in Volume at line 125
HasMany images()

The images belonging to this volume.

Return Value

HasMany

in Volume at line 135
HasMany videos()

The videos belonging to this volume.

Return Value

HasMany

in Volume at line 145
HasMany files()

The images or videos belonging to this volume.

Return Value

HasMany

in Volume at line 160
HasMany orderedImages() deprecated

deprecated Use `orderedFiles` instead.

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

Return Value

HasMany

in Volume at line 170
HasMany orderedFiles()

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

Return Value

HasMany

in Volume at line 180
Builder users()

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

Return Value

Builder

in Volume at line 199
BelongsToMany projects()

The project(s), this volume belongs to.

Return Value

BelongsToMany

in Volume at line 209
HasMany annotationSessions()

The annotation sessions of this volume.

Return Value

HasMany

in Volume at line 219
HasOne activeAnnotationSession()

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

Return Value

HasOne

in Volume at line 239
AnnotationSession 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

in Volume at line 259
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

in Volume at line 286
bool isRemote()

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

Return Value

bool

in Volume at line 296
Image getThumbnailAttribute()

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

Return Value

Image

in Volume at line 308
string getThumbnailUrlAttribute()

URL to the thumbnail image of this volume.

Return Value

string

in Volume at line 318
Collection getThumbnailsAttribute()

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

Return Value

Collection

in Volume at line 342
array getThumbnailsUrlAttribute()

URLs to the thumbnail images of this volume.

Return Value

array

in Volume at line 350
flushThumbnailCache()

Flush the cache that stores the volume thumbnail.

in Volume at line 360
bool hasGeoInfo()

Check if the volume has some images with GPS coordinates.

Return Value

bool

in Volume at line 368
flushGeoInfoCache()

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

in Volume at line 381
setUrlAttribute(string $value)

Set the url attribute of this volume.

Parameters

string $value

in Volume at line 396
setCreatingAsyncAttribute(string $value)

Set the creating_async attribute of this volume.

Parameters

string $value

in Volume at line 408
string getCreatingAsyncAttribute()

Get the creating_async attribute of this volume.

Return Value

string

in Volume at line 418
bool hasTiledImages()

Check if the there are tiled images in this volume.

Return Value

bool

in Volume at line 429
bool isImageVolume()

Specifies whether the volume is an image volume.

Return Value

bool

in Volume at line 439
bool isVideoVolume()

Specifies whether the volume is a video volume.

Return Value

bool

in Volume at line 450
saveIfdo(UploadedFile $file)

Save an iFDO metadata file and link it with this volume.

Parameters

UploadedFile $file

iFDO YAML file.

in Volume at line 463
bool hasIfdo(bool $ignoreErrors = false)

Check if an iFDO metadata file is available for this volume.

Parameters

bool $ignoreErrors

Set to true to ignore exceptions and return false if iFDO existence could not be determined.

Return Value

bool

in Volume at line 479
deleteIfdo()

Delete the iFDO metadata file linked with this volume.

in Volume at line 490
Response downloadIfdo()

Download the iFDO that is attached to this volume.

Return Value

Response

in Volume at line 506
array getIfdo()

Get the content of the iFDO file associated with this volume.

Return Value

array

in Volume at line 518
protected string getIfdoFilename()

Get the filename of the volume iFDO in storage.

Return Value

string

in Volume at line 528
protected string getThumbnailsCacheKey()

Get the cache key for volume thumbnails.

Return Value

string

in Volume at line 538
protected string getGeoInfoCacheKey()

Get the cache key for volume geo info.

Return Value

string

in Volume at line 548
protected string getIfdoCacheKey()

Get the cache key for volume iFDO info.

Return Value

string

at line 27
static Volume convert(Volume $volume)

Converts a regular Biigle volume to an export volume.

Parameters

Volume $volume

Regular Biigle volume instance

Return Value

Volume

at line 41
array getExportAreaAttribute()

Return the dynamic attribute for the export area.

Return Value

array

at line 51
setExportAreaAttribute(array $value)

Set or update the dynamic attribute for the export area.

Parameters

array $value

The value to set