class AnnotationSession extends Model

An annotation session groups multiple annotations of a volume based on their creation date.

Traits

HasFactory

Properties

protected list<string> $appends

The accessors to append to the model's array form.

Methods

array
casts()

Get the attributes that should be cast.

Volume, $this>
volume()

The volume, this annotation session belongs to.

User, $this>
users()

The users, this annotation session is restricted to.

getVolumeFileAnnotations(VolumeFile $file, User $user, array $load = [])

Get the annotations of the file (with labels), filtered by the restrictions of this annotation session.

ImageAnnotation>|VideoAnnotation>
annotations()

Get a query for all annotations that belong to this session.

bool
allowsAccess(Annotation $annotation, User $user)

Check if the given user is allowed to access the annotation if this annotation session is active.

setStartsAtAttribute(mixed $value)

Set the start date.

setEndsAtAttribute(mixed $value)

Set the end date.

string
getStartsAtIso8601Attribute()

Get the start date formatted as ISO8601 string.

string
getEndsAtIso8601Attribute()

Get the end date formatted as ISO8601 string.

Builder
imageAnnotations()

Get a query for all image annotations that belong to this session.

Builder
videoAnnotations()

Get a query for all video annotations that belong to this session.

Details

at line 24
protected array casts()

Get the attributes that should be cast.

Return Value

array

at line 50
Volume, $this> volume()

The volume, this annotation session belongs to.

Return Value

Volume, $this>

at line 60
User, $this> users()

The users, this annotation session is restricted to.

Return Value

User, $this>

at line 75
Generator getVolumeFileAnnotations(VolumeFile $file, User $user, array $load = [])

Get the annotations of the file (with labels), filtered by the restrictions of this annotation session.

Parameters

VolumeFile $file

The file to get the annotations from

User $user

The user to whom the restrictions should apply ('own' user)

array $load

Models that should also be loaded

Return Value

Generator

at line 130
ImageAnnotation>|VideoAnnotation> annotations()

Get a query for all annotations that belong to this session.

This is not an Eloquent relation!

Return Value

ImageAnnotation>|VideoAnnotation>

at line 146
bool allowsAccess(Annotation $annotation, User $user)

Check if the given user is allowed to access the annotation if this annotation session is active.

Parameters

Annotation $annotation
User $user

Return Value

bool

at line 167
setStartsAtAttribute(mixed $value)

Set the start date.

Parameters

mixed $value

The date (must be parseable by Carbon)

at line 181
setEndsAtAttribute(mixed $value)

Set the end date.

Parameters

mixed $value

The date (must be parseable by Carbon)

at line 195
string getStartsAtIso8601Attribute()

Get the start date formatted as ISO8601 string.

Return Value

string

at line 205
string getEndsAtIso8601Attribute()

Get the end date formatted as ISO8601 string.

Return Value

string

at line 217
Builder imageAnnotations()

Get a query for all image annotations that belong to this session.

This is not an Eloquent relation!

Return Value

Builder

at line 251
Builder videoAnnotations()

Get a query for all video annotations that belong to this session.

This is not an Eloquent relation!

Return Value

Builder