class Project extendsProject

Properties

protectedarray $hidden The attributes hidden from the model's JSON form. from Project

Methods

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.

from Project
BelongsToMany
users()

The members of this project. Every member has a project-specific project_role_id besides their global user role.

from Project
BelongsToMany
admins()

All members of this project with the admin role.

from Project
BelongsToMany
editors()

All members of this project with the editor role.

from Project
BelongsToMany
guests()

All members of this project with the guest role.

from Project
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.

from Project
void
addUserId(int$userId,int$roleId)

Adds the user with the given role to this project.

from Project
void
changeRole(int$userId,int$roleId)

Changes the role of an existing user in this project.

from Project
bool
userCanBeRemoved(int$userId)

Determines if the user can be removed from the project.

from Project
bool
removeUserId(int$userId)

Removes the user by ID from this project.

from Project
BelongsToMany
volumes()

The volumes of this project.

from Project
void
addVolumeId(int$id)deprecated

Adds a volume to this project if it wasn't already.

from Project
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.

from Project
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.

from Project
BelongsToMany
labelTrees()

The label trees, this project is using.

from Project
BelongsToMany
authorizedLabelTrees()

The private label trees that authorized this project to use them.

from Project
string
getThumbnailUrlAttribute()

URL to a unique thumbnail image for this project.

from Project
bool
hasGeoInfo()

Check if the project has volumes which have some images with GPS coordinates.

from Project
flushGeoInfoCache()

Flush the cached information if this project has volumes which have images with GPS coordinates.

from Project
HasMany
videos()

The videos of this project.

Details

inProjectat 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.

Parameters

Builder $query
User $user
int $volumeId
array $roles Array of role IDs to restrict the project membership to. Default is any role.

Return Value

Builder

inProjectat line53
BelongsToMany users()

The members of this project. Every member has a project-specific project_role_id besides their global user role.

Return Value

BelongsToMany

inProjectat line64
BelongsToMany admins()

All members of this project with the admin role.

Return Value

BelongsToMany

inProjectat line74
BelongsToMany editors()

All members of this project with the editor role.

Return Value

BelongsToMany

inProjectat line84
BelongsToMany guests()

All members of this project with the guest role.

Return Value

BelongsToMany

inProjectat 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.

Return Value

BelongsTo

inProjectat line108
void addUserId(int$userId,int$roleId)

Adds the user with the given role to this project.

Parameters

int $userId
int $roleId

Return Value

void

inProjectat line120
void changeRole(int$userId,int$roleId)

Changes the role of an existing user in this project.

Parameters

int $userId
int $roleId

Return Value

void

inProjectat line131
bool userCanBeRemoved(int$userId)

Determines if the user can be removed from the project.

Parameters

int $userId

Return Value

bool

inProjectat line142
bool removeUserId(int$userId)

Removes the user by ID from this project.

Parameters

int $userId

Return Value

bool

inProjectat line156
BelongsToMany volumes()

The volumes of this project.

Return Value

BelongsToMany

inProjectat line168
void addVolumeId(int$id)deprecated

deprecated Use `$project->volumes()->attach($id)` instead.

Adds a volume to this project if it wasn't already.

Parameters

int $id

Return Value

void

inProjectat 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.

Parameters

Volume $volume
bool $force Delete the volume completely if this is the last project it belongs to

inProjectat 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.

Parameters

bool $force

inProjectat line236
BelongsToMany labelTrees()

The label trees, this project is using.

Return Value

BelongsToMany

inProjectat line246
BelongsToMany authorizedLabelTrees()

The private label trees that authorized this project to use them.

Return Value

BelongsToMany

inProjectat line256
string getThumbnailUrlAttribute()

URL to a unique thumbnail image for this project.

Return Value

string

inProjectat line283
bool hasGeoInfo()

Check if the project has volumes which have some images with GPS coordinates.

Return Value

bool

inProjectat line301
flushGeoInfoCache()

Flush the cached information if this project has volumes which have images with GPS coordinates.

at line14
HasMany videos()

The videos of this project.

Return Value

HasMany