Project
class Project extendsModel
Properties
$hidden | The attributes hidden from the model's JSON form. |
Methods
Scope a query to all projects that the user and the volume with the given ID have in common.
The members of this project. Every member has a project-specific
project_role_id
besides their global user role.
All members of this project with the admin
role.
All members of this project with the editor
role.
All members of this project with the guest
role.
The user that created this project. On creation this user is automatically added to the project's users with the 'admin' role by the ProjectObserver.
Adds the user with the given role to this project.
Changes the role of an existing user in this project.
Determines if the user can be removed from the project.
Removes the user by ID from this project.
The volumes of this project.
Detaches the volume from this project. Fails if this is the last
project, the volume is attached to, unless force is true
.
Detaches all volumes from this project. Fails if this is the last
project, one of the volumes is attached to, unless force is true
.
The label trees, this project is using.
The private label trees that authorized this project to use them.
URL to a unique thumbnail image for this project.
Check if the project has volumes which have some images with GPS coordinates.
Flush the cached information if this project has volumes which have images with GPS coordinates.
Details
at line32
Builder
scopeInCommon(Builder$query,User$user,int$volumeId,array$roles =null)
Scope a query to all projects that the user and the volume with the given ID have in common.
at line53
BelongsToMany
users()
The members of this project. Every member has a project-specific
project_role_id
besides their global user role.
at line64
BelongsToMany
admins()
All members of this project with the admin
role.
at line74
BelongsToMany
editors()
All members of this project with the editor
role.
at line84
BelongsToMany
guests()
All members of this project with the guest
role.
at line96
BelongsTo
creator()
The user that created this project. On creation this user is automatically added to the project's users with the 'admin' role by the ProjectObserver.
at line108
void
addUserId(int$userId,int$roleId)
Adds the user with the given role to this project.
at line120
void
changeRole(int$userId,int$roleId)
Changes the role of an existing user in this project.
at line131
bool
userCanBeRemoved(int$userId)
Determines if the user can be removed from the project.
at line142
bool
removeUserId(int$userId)
Removes the user by ID from this project.
at line156
BelongsToMany
volumes()
The volumes of this project.
at line168
void
addVolumeId(int$id)deprecated
deprecated
Adds a volume to this project if it wasn't already.
at line183
removeVolume(Volume$volume,bool$force =false)
Detaches the volume from this project. Fails if this is the last
project, the volume is attached to, unless force is true
.
at line213
removeAllVolumes(bool$force =false)
Detaches all volumes from this project. Fails if this is the last
project, one of the volumes is attached to, unless force is true
.
at line236
BelongsToMany
labelTrees()
The label trees, this project is using.
at line246
BelongsToMany
authorizedLabelTrees()
The private label trees that authorized this project to use them.
at line256
string
getThumbnailUrlAttribute()
URL to a unique thumbnail image for this project.
at line283
bool
hasGeoInfo()
Check if the project has volumes which have some images with GPS coordinates.
at line301
flushGeoInfoCache()
Flush the cached information if this project has volumes which have images with GPS coordinates.