LabelTree
class LabelTree extends Model
A label tree is a group of labels. Projects can choose to used different label trees, which are then offered for labeling things in the project.
Label trees have admins and editors as members. Editors can add and delete labels. Admins can also manage members and modify the tree (name, visibility etc). Label trees can be public or private. Private trees maintain a list of projects that are authorized to use the tree. This list is maintained by label tree admins.
Traits
Properties
$hidden | The attributes hidden from the model's JSON form. |
||
protected array | $casts | The attributes that should be casted to native types. |
Methods
Scope a query to public label trees.
Scope a query to private label trees.
Scope a query to all trees that are accessible by a user.
Scope a query to all trees that are not a varsion of another tree.
Scope a query to all "global" trees.
The version of this label tree (if it is a version of a master label tree).
The versions of this (master) label tree.
The visibility of the label tree.
The members of this label tree. Every member has a tree-specific role.
The labels that belong to this tree.
Determines if the label tree can be safely deleted.
The projects that are using this label tree.
The projects that are authorized to use this private label tree.
Detaches all projects that are not among the authorized projects.
Get the name with a version suffix of this label tree.
Details
at line 49
bool
memberCanLooseAdminStatus(User $member)
Check if a member can loose their admin status.
at line 63
Builder
scopePublicTrees(Builder $query)
Scope a query to public label trees.
at line 74
Builder
scopePrivateTrees(Builder $query)
Scope a query to private label trees.
at line 86
Builder
scopeAccessibleBy(Builder $query, User $user)
Scope a query to all trees that are accessible by a user.
at line 124
Builder
scopeWithoutVersions(Builder $query)
Scope a query to all trees that are not a varsion of another tree.
at line 136
Builder
scopeGlobal(Builder $query)
Scope a query to all "global" trees.
at line 148
BelongsTo
version()
The version of this label tree (if it is a version of a master label tree).
at line 158
HasMany
versions()
The versions of this (master) label tree.
at line 168
BelongsTo
visibility()
The visibility of the label tree.
at line 178
BelongsToMany
members()
The members of this label tree. Every member has a tree-specific role.
at line 190
HasMany
labels()
The labels that belong to this tree.
at line 202
bool
canBeDeleted()
Determines if the label tree can be safely deleted.
A label tree can be safely deleted if none if its labels or the labels of any of its versions are in use.
at line 258
bool
memberCanBeRemoved(User $member)
Determines if a member can be removed.
A member can be removed if at least one admin member remains afterwards.
at line 268
BelongsToMany
projects()
The projects that are using this label tree.
at line 278
BelongsToMany
authorizedProjects()
The projects that are authorized to use this private label tree.
at line 286
detachUnauthorizedProjects()
Detaches all projects that are not among the authorized projects.
at line 312
string
getVersionedNameAttribute()
Get the name with a version suffix of this label tree.
at line 326
replicateLabelsOf(LabelTree $tree)
Replicate all labels of one label tree to this one.