PHP Class BookStack\Entity

Inheritance: extends Illuminate\Database\Eloquent\Model, use trait Ownable
ファイルを表示 Open project: ssddanbrown/bookstack Class Usage Examples

Public Methods

Method Description
activity ( ) : Illuminate\Database\Eloquent\Relations\MorphMany Gets the activity objects for this entity.
fullTextSearchQuery ( string[] $fieldsToSearch, string[] $terms, $wheres = [] ) : mixed Perform a full-text search on this entity.
getEntityInstance ( $type ) : Entity Get an instance of an entity of the given type.
getShortName ( integer $length = 25 ) : string Gets a limited-length version of the entities name.
getType ( ) : mixed Get entity type.
hasActiveRestriction ( $role_id, $action ) : boolean Check if this entity has live (active) restrictions in place.
hasRestriction ( $role_id, $action ) : boolean Check if this entity has a specific restriction set against it.
isA ( $type ) : boolean Allows checking of the exact class, Used to check entity type.
jointPermissions ( ) : Illuminate\Database\Eloquent\Relations\MorphMany Get the entity jointPermissions this is connected to.
matches ( $entity ) : boolean Compares this entity to another given entity.
matchesOrContains ( Entity $entity ) : boolean Checks if an entity matches or contains another given entity.
permissions ( ) Get this entities restrictions.
tags ( ) : Illuminate\Database\Eloquent\Relations\MorphMany Get the Tag models that have been user assigned to this entity.
views ( ) Get View objects for this entity.

Method Details

activity() public method

Gets the activity objects for this entity.
public activity ( ) : Illuminate\Database\Eloquent\Relations\MorphMany
return Illuminate\Database\Eloquent\Relations\MorphMany

fullTextSearchQuery() public method

Perform a full-text search on this entity.
public fullTextSearchQuery ( string[] $fieldsToSearch, string[] $terms, $wheres = [] ) : mixed
$fieldsToSearch string[]
$terms string[]
return mixed

getEntityInstance() public static method

Get an instance of an entity of the given type.
public static getEntityInstance ( $type ) : Entity
$type
return Entity

getShortName() public method

Gets a limited-length version of the entities name.
public getShortName ( integer $length = 25 ) : string
$length integer
return string

getType() public static method

Get entity type.
public static getType ( ) : mixed
return mixed

hasActiveRestriction() public method

Check if this entity has live (active) restrictions in place.
public hasActiveRestriction ( $role_id, $action ) : boolean
$role_id
$action
return boolean

hasRestriction() public method

Check if this entity has a specific restriction set against it.
public hasRestriction ( $role_id, $action ) : boolean
$role_id
$action
return boolean

isA() public static method

Cleaner method for is_a.
public static isA ( $type ) : boolean
$type
return boolean

jointPermissions() public method

Get the entity jointPermissions this is connected to.
public jointPermissions ( ) : Illuminate\Database\Eloquent\Relations\MorphMany
return Illuminate\Database\Eloquent\Relations\MorphMany

matches() public method

Matches by comparing class and id.
public matches ( $entity ) : boolean
$entity
return boolean

matchesOrContains() public method

Checks if an entity matches or contains another given entity.
public matchesOrContains ( Entity $entity ) : boolean
$entity Entity
return boolean

permissions() public method

Get this entities restrictions.
public permissions ( )

tags() public method

Get the Tag models that have been user assigned to this entity.
public tags ( ) : Illuminate\Database\Eloquent\Relations\MorphMany
return Illuminate\Database\Eloquent\Relations\MorphMany

views() public method

Get View objects for this entity.
public views ( )