PHP Класс BookStack\Services\ActivityService

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$activity
$permissionService
$user

Открытые методы

Метод Описание
__construct ( Activity $activity, PermissionService $permissionService ) ActivityService constructor.
add ( Entity $entity, $activityKey, integer $bookId, boolean $extra = false ) Add activity data to database.
addMessage ( $activityKey, integer $bookId, boolean | false $extra = false ) Adds a activity history with a message & without binding to a entity.
entityActivity ( Entity $entity, integer $count = 20, integer $page ) : array Gets the latest activity for an entity, Filtering out similar items to prevent a message activity list.
latest ( integer $count = 20, integer $page ) : array Gets the latest activity.
removeEntity ( Entity $entity ) : mixed Removes the entity attachment from each of its activities and instead uses the 'extra' field with the entities name.
userActivity ( $user, integer $count = 20, integer $page ) : array Get latest activity for a user, Filtering out similar items.

Защищенные методы

Метод Описание
filterSimilar ( Activity[] $activities ) : array Filters out similar activity.
setNotification ( $activityKey ) Flashes a notification message to the session if an appropriate message is available.

Описание методов

__construct() публичный Метод

ActivityService constructor.
public __construct ( Activity $activity, PermissionService $permissionService )
$activity BookStack\Activity
$permissionService PermissionService

add() публичный Метод

Add activity data to database.
public add ( Entity $entity, $activityKey, integer $bookId, boolean $extra = false )
$entity BookStack\Entity
$activityKey
$bookId integer
$extra boolean

addMessage() публичный Метод

Adds a activity history with a message & without binding to a entity.
public addMessage ( $activityKey, integer $bookId, boolean | false $extra = false )
$activityKey
$bookId integer
$extra boolean | false

entityActivity() публичный Метод

Gets the latest activity for an entity, Filtering out similar items to prevent a message activity list.
public entityActivity ( Entity $entity, integer $count = 20, integer $page ) : array
$entity BookStack\Entity
$count integer
$page integer
Результат array

filterSimilar() защищенный Метод

Filters out similar activity.
protected filterSimilar ( Activity[] $activities ) : array
$activities BookStack\Activity[]
Результат array

latest() публичный Метод

Gets the latest activity.
public latest ( integer $count = 20, integer $page ) : array
$count integer
$page integer
Результат array

removeEntity() публичный Метод

Used when an entity is deleted.
public removeEntity ( Entity $entity ) : mixed
$entity BookStack\Entity
Результат mixed

setNotification() защищенный Метод

Flashes a notification message to the session if an appropriate message is available.
protected setNotification ( $activityKey )
$activityKey

userActivity() публичный Метод

Get latest activity for a user, Filtering out similar items.
public userActivity ( $user, integer $count = 20, integer $page ) : array
$user
$count integer
$page integer
Результат array

Описание свойств

$activity защищенное свойство

protected $activity

$permissionService защищенное свойство

protected $permissionService

$user защищенное свойство

protected $user