AccessChecker
Class AccessChecker
Table of Contents
Constants
- ERR_CODE_EDIT = 'ERR_EDIT'
- ERR_CODE_NOT_FOUND = 'ERR_NOT_FOUND'
- ERR_CODE_VIEW = 'ERR_VIEW'
Methods
- addError() : void
- Add error.
- checkViewAccess() : bool
- Check view access.
- getError() : Error
- Get error.
- getMessage() : string
- Get message.
Constants
ERR_CODE_EDIT
public
mixed
ERR_CODE_EDIT
= 'ERR_EDIT'
ERR_CODE_NOT_FOUND
public
mixed
ERR_CODE_NOT_FOUND
= 'ERR_NOT_FOUND'
ERR_CODE_VIEW
public
mixed
ERR_CODE_VIEW
= 'ERR_VIEW'
Methods
addError()
Add error.
public
static addError(ErrorCollection $collection[, string $code = self::ERR_CODE_VIEW ]) : void
Parameters
- $collection : ErrorCollection
-
Error collection.
- $code : string = self::ERR_CODE_VIEW
-
Code.
checkViewAccess()
Check view access.
public
static checkViewAccess(ErrorCollection $collection[, User $user = null ]) : bool
Parameters
- $collection : ErrorCollection
-
Error collection.
- $user : User = null
-
User.
Return values
boolgetError()
Get error.
public
static getError([string $code = self::ERR_CODE_VIEW ]) : Error
Parameters
- $code : string = self::ERR_CODE_VIEW
-
Code.
Return values
ErrorgetMessage()
Get message.
public
static getMessage(string $code) : string
Parameters
- $code : string
-
Code.