Label
class Label extends Model
Annotations on an image can have multiple labels. A label is e.g. the
type of the object visible in the region of the annotation. So if
you put a circle annotation around a rock, you would label the annotation
with rock
.
Labels can be ordered in a tree-like structure.
Traits
Properties
$hidden | The attributes hidden from the model's JSON form. |
||
protected array | $casts | The attributes that should be casted to native types. |
|
bool | $timestamps | Don't maintain timestamps for this model. |
Methods
Scope a query to used labels.
The parent label if the labels are ordered in a tree-like structure.
The label tree this label belongs to.
The child labels of this label if they are ordered in a tree-like structue.
Remove the optional '#' from a hexadecimal color.
Determines if the label is used anywhere (e.g. attached to an annotation).
Determines if the label can be deleted.
Details
at line 55
Builder
scopeUsed(Builder $query)
Scope a query to used labels.
at line 86
BelongsTo
parent()
The parent label if the labels are ordered in a tree-like structure.
at line 96
BelongsTo
tree()
The label tree this label belongs to.
at line 107
HasMany
children()
The child labels of this label if they are ordered in a tree-like structue.
at line 117
setColorAttribute(string $value)
Remove the optional '#' from a hexadecimal color.
at line 131
bool
isUsed()
Determines if the label is used anywhere (e.g. attached to an annotation).
at line 144
bool
canBeDeleted()
Determines if the label can be deleted.
A label can be deleted if it doesn't have any child labels and if it is not used anywhere (e.g. attached to an annotation).