com\setasign\SetaSite\Page

PageLocks

File: /SetaSite/src/Page/PageLocks.php

Class hierarchy

Summary

Properties

$lockTable

private \com\setasign\SetaFramework\Database\Table\Table PageLocks::$lockTable

Methods

__construct()

public PageLocks::__construct (
\com\setasign\SetaFramework\Database\Table\Table $lockTable
)
Parameters
$lockTable : \com\setasign\SetaFramework\Database\Table\Table
 

forceRemoveLock()

public PageLocks::forceRemoveLock (
int $pageId,
string $language,
?int $userId = null
): void

This method will remove the lock of $pageId.

If a userId is given it will check whether the active lock is by that user. If not a PageLockException is thrown. It will not be checked whether the lock is allowed to be removed.

Parameters
$pageId : int
 
$language : string
 
$userId : ?int
 
Exceptions

Throws PageLockException

getAllLocks()

public PageLocks::getAllLocks (
?array<int, array{id: int, language: string}> $pages = null
): array
Parameters
$pages : ?array<int, array{id: int, language: string}>

If given the select will be filtered by this ids.

getLockTable()

public PageLocks::getLockTable (
void
): \com\setasign\SetaFramework\Database\Table\Table

getLockValidInfo()

public PageLocks::getLockValidInfo (
int $pageId,
string $language,
int $userId,
\com\setasign\SetaSite\User\Users $users,
int $timeout
): ?array
Parameters
$pageId : int
 
$language : string
 
$userId : int
 
$users : \com\setasign\SetaSite\User\Users
 
$timeout : int
 
Return Values

null if no lock exist

hasLock()

public PageLocks::hasLock (
int $pageId,
string $language,
?int $userId = null
): bool
Parameters
$pageId : int
 
$language : string
 
$userId : ?int
 

isEditMode()

public PageLocks::isEditMode (
int $pageId,
string $language,
int $userId
): bool
Parameters
$pageId : int
 
$language : string
 
$userId : int
 

isLockedByUser()

public PageLocks::isLockedByUser (
int $pageId,
string $language,
?int $userId = null
): bool

Checks whether there is an lock by user $userId on page $pageId.

Doesn't check the validity of the user

Parameters
$pageId : int
 
$language : string
 
$userId : ?int
 

removeLock()

public PageLocks::removeLock (
\com\setasign\SetaSite\User\Users $users,
int $timeout,
int $pageId,
string $language,
?int $activeUserId = null
): void
Parameters
$users : \com\setasign\SetaSite\User\Users
 
$timeout : int
 
$pageId : int
 
$language : string
 
$activeUserId : ?int
 
Exceptions

Throws PageLockException

setLock()

public PageLocks::setLock (
int $pageId,
string $language,
int $userId
): void
Parameters
$pageId : int
 
$language : string
 
$userId : int
 
Exceptions

Throws \com\setasign\SetaFramework\Exception

Throws PageLockException