Arikaim CMS

Repository extends ControlPanelApiController
in package

Repository controller

Table of Contents

Properties

$container  : Container|null
Container
$dataErrorCallback  : Closure|null
Data error callback
$dataValidCallback  : Closure|null
Data validatin callback
$errors  : array<string|int, mixed>
Errors list
$extensionName  : string|null
Extension name
$messages  : array<string|int, mixed>
Response messages
$messagesComponentName  : string
Messages component name
$messagesLoaded  : bool
Messages loaded
$modelClass  : string
Model class name
$pageName  : string|null
Page name
$params  : array<string|int, mixed>
Controller params
$response  : ResponseInterface|null
Response
$result  : array<string|int, mixed>
Response result
$validationErrorMessages  : array<string|int, mixed>
Validation error messages

Methods

__call()  : mixed
Run {method name}Controller function if exist
__construct()  : mixed
Constructor
addError()  : void
Add system error
addErrors()  : void
Add errors
clearErrors()  : void
Clear all errors.
clearResult()  : void
Clear result
dispatch()  : mixed|false
Dispatch event
error()  : self
Set error, first find in messages array if not found display name value as error
field()  : self
Set result field
fields()  : self
Set fields
get()  : mixed
Get item from container
getContainer()  : Container
Get container
getDataValidCallback()  : Closure|null
Get data validation callback
getDefaultLanguage()  : string
Get default language
getError()  : string
Get error
getErrorCount()  : int
Return errors count
getExtensionName()  : string|null
Get extension name
getMessage()  : string|null
Get message
getModelClass()  : string|null
Get model class name
getPageLanguage()  : string
Get page language
getPageName()  : string|null
Get page name
getPageUrl()  : string
Get page url
getParam()  : mixed|null
Get param
getParams()  : array<string|int, mixed>
Get params
getQueryParam()  : mixed
Get query param
getRequestParams()  : array<string|int, mixed>
Get request params
getResponse()  : ResponseInterface
Return response
getResponseJson()  : string
Return json
getUrl()  : string
Get url
getUserId()  : int|null
Return current logged user id
getValidationErrorCallback()  : Closure|null
Get validation error callback
has()  : bool
Return true if container item esist
hasAccess()  : bool
Return true if user have access permission
hasControlPanelAccess()  : bool
Return true if user have control panel access
hasError()  : bool
Return true if response have error
hasService()  : bool
Return true service exists
init()  : void
Init controller
isLanguageChange()  : bool
Return true if page load is with new language code
loadMessages()  : void
Load messages from html component json file
logError()  : bool
Log error
logInfo()  : bool
Log message
message()  : ApiController
Add message to response, first find in messages array if not found display name value as message
noCacheHeaders()  : ResponseInterface
Set no cache in Cache-Control
onDataValid()  : void
Set callback for validation done
onValidationError()  : void
Set callback for validation errors
repositoryDownload()  : ResponseInterface
Dowload and install repository from repository
requireAccess()  : void
Reguire permission check if current user have permission
requireControlPanelPermission()  : void
Require control panel permission
requireUser()  : void
Check logged user id
requireUserOrControlPanel()  : void
Check logged user id or contorl panel
resolveRequestParams()  : array<string|int, mixed>
Resolve params
setError()  : void
Set error message
setErrors()  : void
Set errors
setExtensionName()  : void
Set extension name
setHttpResponse()  : void
Set http response instance
setModelClass()  : void
Set model class name
setResponse()  : mixed
Set response
setResult()  : self
Set response result
setResultField()  : void
Set field to result array
setResultFields()  : void
Set result filelds
user()  : mixed
Return current logged user
withError()  : self
Set error message
withRedirect()  : ResponseInterface
Set redirect headers
withService()  : mixed
Run closure with serice
getValidationErrorMessage()  : string|null
Get validaiton error message
loadMesasgesComponent()  : void
Load messages component
resolveRouteParams()  : bool
Resolve route params
resolveValidationErrors()  : array<string|int, mixed>
Resolve validation errors

Properties

$dataErrorCallback

Data error callback

protected Closure|null $dataErrorCallback = null

$dataValidCallback

Data validatin callback

protected Closure|null $dataValidCallback = null

$errors

Errors list

protected array<string|int, mixed> $errors = []

$extensionName

Extension name

protected string|null $extensionName = null

$messages

Response messages

protected array<string|int, mixed> $messages = []

$messagesComponentName

Messages component name

protected string $messagesComponentName = ''

$messagesLoaded

Messages loaded

protected bool $messagesLoaded = false

$modelClass

Model class name

protected string $modelClass = null

$params

Controller params

protected array<string|int, mixed> $params = []

$response

Response

protected ResponseInterface|null $response = null

$result

Response result

protected array<string|int, mixed> $result

$validationErrorMessages

Validation error messages

protected array<string|int, mixed> $validationErrorMessages = []

Methods

__call()

Run {method name}Controller function if exist

public __call(string $name, array<string|int, mixed> $arguments) : mixed
Parameters
$name : string
$arguments : array<string|int, mixed>
Tags
throws
Exception

__construct()

Constructor

public __construct([Container $container = null ]) : mixed
Parameters
$container : Container = null

addError()

Add system error

public addError(string $errorCode) : void
Parameters
$errorCode : string

addErrors()

Add errors

public addErrors(array<string|int, mixed> $errors) : void
Parameters
$errors : array<string|int, mixed>

clearErrors()

Clear all errors.

public clearErrors() : void

clearResult()

Clear result

public clearResult() : void

dispatch()

Dispatch event

public dispatch(string $eventName, array<string|int, mixed> $params) : mixed|false
Parameters
$eventName : string
$params : array<string|int, mixed>
Return values
mixed|false

error()

Set error, first find in messages array if not found display name value as error

public error(string $name[, string|null $default = null ]) : self
Parameters
$name : string
$default : string|null = null
Return values
self

field()

Set result field

public field(string $name, mixed $value) : self
Parameters
$name : string
$value : mixed
Return values
self

fields()

Set fields

public fields(array<string|int, mixed> $data[, string|null $filedName = null ]) : self
Parameters
$data : array<string|int, mixed>
$filedName : string|null = null
Return values
self

get()

Get item from container

public get(string $id) : mixed
Parameters
$id : string

getContainer()

Get container

public getContainer() : Container
Return values
Container

getDataValidCallback()

Get data validation callback

public getDataValidCallback() : Closure|null
Return values
Closure|null

getDefaultLanguage()

Get default language

public getDefaultLanguage() : string
Return values
string

getError()

Get error

public getError(string $errorCode) : string
Parameters
$errorCode : string
Return values
string

getErrorCount()

Return errors count

public getErrorCount() : int
Return values
int

getExtensionName()

Get extension name

public getExtensionName() : string|null
Return values
string|null

getMessage()

Get message

public getMessage(string $name) : string|null
Parameters
$name : string
Return values
string|null

getModelClass()

Get model class name

public getModelClass() : string|null
Return values
string|null

getPageLanguage()

Get page language

public getPageLanguage([array<string|int, mixed> $data = [] ][, bool $skipSession = false ]) : string
Parameters
$data : array<string|int, mixed> = []
$skipSession : bool = false
Return values
string

getPageName()

Get page name

public getPageName() : string|null
Return values
string|null

getPageUrl()

Get page url

public getPageUrl([string $path = '' ][, bool $relative = false ][, string|null $language = null ]) : string
Parameters
$path : string = ''
$relative : bool = false
$language : string|null = null
Return values
string

getParam()

Get param

public getParam(string $key[, mixed|null $default = null ]) : mixed|null
Parameters
$key : string
$default : mixed|null = null
Return values
mixed|null

getParams()

Get params

public getParams() : array<string|int, mixed>
Return values
array<string|int, mixed>

getQueryParam()

Get query param

public getQueryParam(ServerRequestInterface $request, string $name[, mixed $default = null ]) : mixed
Parameters
$request : ServerRequestInterface
$name : string
$default : mixed = null

getRequestParams()

Get request params

public getRequestParams(Request $request) : array<string|int, mixed>
Parameters
$request : Request
Return values
array<string|int, mixed>

getResponse()

Return response

public getResponse([bool $raw = false ][, ResponseInterface|null $response = null ][, bool $progress = false ]) : ResponseInterface
Parameters
$raw : bool = false
$response : ResponseInterface|null = null
$progress : bool = false
Return values
ResponseInterface

getResponseJson()

Return json

public getResponseJson([bool $raw = false ]) : string
Parameters
$raw : bool = false
Return values
string

getUrl()

Get url

public getUrl(ServerRequestInterface $request[, bool $relative = false ]) : string
Parameters
$request : ServerRequestInterface
$relative : bool = false
Return values
string

getUserId()

Return current logged user id

public getUserId() : int|null
Return values
int|null

getValidationErrorCallback()

Get validation error callback

public getValidationErrorCallback() : Closure|null
Return values
Closure|null

has()

Return true if container item esist

public has(string $id) : bool
Parameters
$id : string
Return values
bool

hasAccess()

Return true if user have access permission

public hasAccess(string $name[, mixed $type = null ][, string|int|null $authId = null ]) : bool
Parameters
$name : string
$type : mixed = null
$authId : string|int|null = null

For current user - null

Return values
bool

hasControlPanelAccess()

Return true if user have control panel access

public hasControlPanelAccess() : bool
Return values
bool

hasError()

Return true if response have error

public hasError() : bool
Return values
bool

hasService()

Return true service exists

public hasService(string $id) : bool
Parameters
$id : string
Return values
bool

isLanguageChange()

Return true if page load is with new language code

public isLanguageChange(array<string|int, mixed> $data) : bool
Parameters
$data : array<string|int, mixed>
Return values
bool

loadMessages()

Load messages from html component json file

public loadMessages(string $componentName) : void
Parameters
$componentName : string

logError()

Log error

public logError(string $message[, array<string|int, mixed> $context = [] ]) : bool
Parameters
$message : string
$context : array<string|int, mixed> = []
Return values
bool

logInfo()

Log message

public logInfo(string $message[, array<string|int, mixed> $context = [] ]) : bool
Parameters
$message : string
$context : array<string|int, mixed> = []
Return values
bool

message()

Add message to response, first find in messages array if not found display name value as message

public message(string $name[, string|null $default = null ]) : ApiController
Parameters
$name : string
$default : string|null = null
Return values
ApiController

noCacheHeaders()

Set no cache in Cache-Control

public noCacheHeaders(mixed $response) : ResponseInterface
Parameters
$response : mixed
Return values
ResponseInterface

onDataValid()

Set callback for validation done

public onDataValid(Closure $callback) : void
Parameters
$callback : Closure

onValidationError()

Set callback for validation errors

public onValidationError(Closure $callback) : void
Parameters
$callback : Closure

repositoryDownload()

Dowload and install repository from repository

public repositoryDownload(ServerRequestInterface $request, ResponseInterface $response, Validator $data) : ResponseInterface
Parameters
$request : ServerRequestInterface
$response : ResponseInterface
$data : Validator
Return values
ResponseInterface

requireAccess()

Reguire permission check if current user have permission

public requireAccess(string $name[, mixed $type = null ][, string|int|null $authId = null ]) : void
Parameters
$name : string
$type : mixed = null
$authId : string|int|null = null

For current user - null

Tags
throws
HttpException

requireControlPanelPermission()

Require control panel permission

public requireControlPanelPermission() : void
Tags
throws
HttpException

requireUser()

Check logged user id

public requireUser(string|int $userId) : void
Parameters
$userId : string|int
Tags
throws
HttpException

requireUserOrControlPanel()

Check logged user id or contorl panel

public requireUserOrControlPanel(string|int $userId) : void
Parameters
$userId : string|int
Tags
throws
HttpException

resolveRequestParams()

Resolve params

public resolveRequestParams(Request $request, array<string|int, mixed> $paramsKeys) : array<string|int, mixed>
Parameters
$request : Request
$paramsKeys : array<string|int, mixed>
Return values
array<string|int, mixed>

setError()

Set error message

public setError(string $errorMessage[, bool $condition = true ]) : void
Parameters
$errorMessage : string
$condition : bool = true

setErrors()

Set errors

public setErrors(array<string|int, mixed> $errors) : void
Parameters
$errors : array<string|int, mixed>

setExtensionName()

Set extension name

public setExtensionName(string|null $name) : void
Parameters
$name : string|null

setHttpResponse()

Set http response instance

public setHttpResponse(ResponseInterface $response) : void
Parameters
$response : ResponseInterface

setModelClass()

Set model class name

public setModelClass(string $class) : void
Parameters
$class : string

setResponse()

Set response

public setResponse(mixed $condition, array<string|int, mixed>|string|Closure $data, string|Closure $error) : mixed
Parameters
$condition : mixed
$data : array<string|int, mixed>|string|Closure
$error : string|Closure

setResult()

Set response result

public setResult(mixed $data) : self
Parameters
$data : mixed
Return values
self

setResultField()

Set field to result array

public setResultField(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed

setResultFields()

Set result filelds

public setResultFields(array<string|int, mixed> $values[, string|null $filedName = null ]) : void
Parameters
$values : array<string|int, mixed>
$filedName : string|null = null

user()

Return current logged user

public user() : mixed

withError()

Set error message

public withError(string $errorMessage[, bool $condition = true ]) : self
Parameters
$errorMessage : string
$condition : bool = true
Return values
self

withRedirect()

Set redirect headers

public withRedirect(ResponseInterface $response, string $url) : ResponseInterface
Parameters
$response : ResponseInterface
$url : string
Return values
ResponseInterface

withService()

Run closure with serice

public withService(string $name, Closure $callback) : mixed
Parameters
$name : string
$callback : Closure

getValidationErrorMessage()

Get validaiton error message

protected getValidationErrorMessage(string $code) : string|null
Parameters
$code : string
Return values
string|null

loadMesasgesComponent()

Load messages component

protected loadMesasgesComponent([string|null $language = null ]) : void
Parameters
$language : string|null = null

resolveRouteParams()

Resolve route params

protected resolveRouteParams(Request $request) : bool
Parameters
$request : Request
Return values
bool

resolveValidationErrors()

Resolve validation errors

protected resolveValidationErrors(array<string|int, mixed> $errors) : array<string|int, mixed>
Parameters
$errors : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results