Bitrix API

PublicDocument extends Document

Table of Contents

Constants

ERROR_ACCESS_DENIED  = 'DOCGEN_ACCESS_ERROR'
ERROR_REQUIRED_PARAMETER  = 'MAIN_CONTROLLER_22001'
ERROR_UNKNOWN_ACTION  = 'MAIN_CONTROLLER_22002'
EVENT_ON_AFTER_ACTION  = 'onAfterAction'
EVENT_ON_BEFORE_ACTION  = 'onBeforeAction'
EXCEPTION_UNKNOWN_ACTION  = 22002
FILE_PARAM_NAME  = 'file'
SCOPE_AJAX  = 'ajax'
SCOPE_CLI  = 'cli'
SCOPE_REST  = 'rest'

Methods

__construct()  : mixed
Constructor Controller.
addAction()  : array<string|int, mixed>|null
className()  : string
Returns the fully qualified name of this class.
configureActions()  : array<string|int, mixed>
convertKeysToCamelCase()  : array<string|int, mixed>|mixed|string
Converts keys of array to camel case notation.
deleteAction()  : null
enablePublicUrlAction()  : array<string|int, mixed>|null
finalizeResponse()  : void
Finalizes response.
forward()  : HttpResponse|mixed
generateActionMethodName()  : string
getAction()  : array<string|int, mixed>|null
getActionUri()  : Uri
Returns uri for ajax end point for the action name. It's a helper, which uses relative action name without controller name.
getAutoWiredParameters()  : array<string|int, mixed>|array<string|int, Parameter>
getButtonTemplatesAction()  : array<string|int, mixed>
getConfigurationOfActions()  : array<string|int, mixed>|null
getCurrentUser()  : CurrentUser
getDefaultAutoWiredParameters()  : array<string|int, Parameter>
getDefaultPreFilters()  : array<string|int, mixed>
getErrorByCode()  : Error
Getting once error with the necessary code.
getErrors()  : array<string|int, Error>
Getting array of errors.
getFeatureAction()  : mixed
getFieldsAction()  : array<string|int, mixed>|null
getFileAction()  : null
getFullEventName()  : string
getImageAction()  : null
getModuleId()  : string
Returns module id.
getPdfAction()  : null
getPrimaryAutoWiredParameter()  : Parameter|null
getRequest()  : HttpRequest
getScope()  : string
getSourceParametersList()  : array<string|int, mixed>
getUnsignedParameters()  : mixed
isLocatedUnderPsr4()  : bool
listAction()  : Page
listNameActions()  : array<string|int, mixed>
Returns list of all
redirectTo()  : Redirect
Redirect to URL.
run()  : HttpResponse|mixed
setCurrentUser()  : void
setScope()  : Controller
setSourceParametersList()  : Controller
showPdfAction()  : array<string|int, mixed>|HttpResponse
updateAction()  : array<string|int, mixed>|null
uploadAction()  : array<string|int, mixed>|null

Constants

ERROR_ACCESS_DENIED

public mixed ERROR_ACCESS_DENIED = 'DOCGEN_ACCESS_ERROR'

ERROR_REQUIRED_PARAMETER

public mixed ERROR_REQUIRED_PARAMETER = 'MAIN_CONTROLLER_22001'

ERROR_UNKNOWN_ACTION

public mixed ERROR_UNKNOWN_ACTION = 'MAIN_CONTROLLER_22002'

EVENT_ON_AFTER_ACTION

public mixed EVENT_ON_AFTER_ACTION = 'onAfterAction'

EVENT_ON_BEFORE_ACTION

public mixed EVENT_ON_BEFORE_ACTION = 'onBeforeAction'

EXCEPTION_UNKNOWN_ACTION

public mixed EXCEPTION_UNKNOWN_ACTION = 22002

FILE_PARAM_NAME

public mixed FILE_PARAM_NAME = 'file'

Methods

__construct()

Constructor Controller.

public __construct([Request|null $request = null ]) : mixed
Parameters
$request : Request|null = null

addAction()

public addAction(Template $template[, mixed $providerClassName = null ][, mixed $value = null ][, array<string|int, mixed> $values = [] ][, int $stampsEnabled = null ][, array<string|int, mixed> $fields = [] ][, CRestServer|null $restServer = null ]) : array<string|int, mixed>|null
Parameters
$template : Template
$providerClassName : mixed = null
$value : mixed = null
$values : array<string|int, mixed> = []
$stampsEnabled : int = null
$fields : array<string|int, mixed> = []
$restServer : CRestServer|null = null
Return values
array<string|int, mixed>|null

className()

Returns the fully qualified name of this class.

public final static className() : string
Return values
string

configureActions()

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

convertKeysToCamelCase()

Converts keys of array to camel case notation.

public convertKeysToCamelCase(mixed $data) : array<string|int, mixed>|mixed|string
Parameters
$data : mixed

Data.

Tags
see
Converter::OUTPUT_JSON_FORMAT
Return values
array<string|int, mixed>|mixed|string

deleteAction()

public deleteAction(Document $document[, CRestServer|null $restServer = null ]) : null
Parameters
$document : Document
$restServer : CRestServer|null = null
Return values
null

enablePublicUrlAction()

public enablePublicUrlAction(Document $document[, int $status = 1 ][, CRestServer|null $restServer = null ]) : array<string|int, mixed>|null
Parameters
$document : Document
$status : int = 1
$restServer : CRestServer|null = null
Return values
array<string|int, mixed>|null

finalizeResponse()

Finalizes response.

public finalizeResponse(Response $response) : void

The method will be invoked when HttpApplication will be ready to send response to client. It's a final place where Controller can interact with response.

Parameters
$response : Response

forward()

public forward(Controller|string $controller, string $actionName[, array<string|int, mixed>|null $parameters = null ]) : HttpResponse|mixed
Parameters
$controller : Controller|string
$actionName : string
$parameters : array<string|int, mixed>|null = null
Tags
throws
SystemException
Return values
HttpResponse|mixed

generateActionMethodName()

public final generateActionMethodName(mixed $action) : string
Parameters
$action : mixed
Return values
string

getAction()

public getAction(Document $document[, CRestServer $restServer = null ][, mixed $hash = '' ]) : array<string|int, mixed>|null
Parameters
$document : Document
$restServer : CRestServer = null
$hash : mixed = ''
Return values
array<string|int, mixed>|null

getActionUri()

Returns uri for ajax end point for the action name. It's a helper, which uses relative action name without controller name.

public final getActionUri(string $actionName[, array<string|int, mixed> $params = [] ][, bool $absolute = false ]) : Uri
Parameters
$actionName : string

Action name. It's a relative action name without controller name.

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

Parameters for creating uri.

$absolute : bool = false
Return values
Uri

getAutoWiredParameters()

public getAutoWiredParameters([Controller $controller = null ]) : array<string|int, mixed>|array<string|int, Parameter>
Parameters
$controller : Controller = null
Return values
array<string|int, mixed>|array<string|int, Parameter>

getButtonTemplatesAction()

public getButtonTemplatesAction(mixed $moduleId, mixed $provider, mixed $value) : array<string|int, mixed>
Parameters
$moduleId : mixed
$provider : mixed
$value : mixed
Return values
array<string|int, mixed>

getConfigurationOfActions()

public final getConfigurationOfActions() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

getDefaultAutoWiredParameters()

public final getDefaultAutoWiredParameters() : array<string|int, Parameter>
Return values
array<string|int, Parameter>

getDefaultPreFilters()

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

getErrorByCode()

Getting once error with the necessary code.

public final getErrorByCode(string $code) : Error
Parameters
$code : string

Code of error.

Return values
Error

getErrors()

Getting array of errors.

public final getErrors() : array<string|int, Error>
Return values
array<string|int, Error>

getFeatureAction()

public getFeatureAction() : mixed

getFieldsAction()

public getFieldsAction(Document $document[, array<string|int, mixed> $values = [] ][, CRestServer|null $restServer = null ]) : array<string|int, mixed>|null
Parameters
$document : Document
$values : array<string|int, mixed> = []
$restServer : CRestServer|null = null
Return values
array<string|int, mixed>|null

getFileAction()

public getFileAction(Document $document[, mixed $fileName = '' ][, CRestServer $restServer = null ][, mixed $hash = '' ]) : null
Parameters
$document : Document
$fileName : mixed = ''
$restServer : CRestServer = null
$hash : mixed = ''
Return values
null

getFullEventName()

public final static getFullEventName(mixed $eventName) : string
Parameters
$eventName : mixed
Return values
string

getImageAction()

public getImageAction(Document $document[, CRestServer $restServer = null ][, mixed $hash = '' ]) : null
Parameters
$document : Document
$restServer : CRestServer = null
$hash : mixed = ''
Return values
null

getModuleId()

Returns module id.

public final getModuleId() : string

Tries to guess module id by file path and function @see getModuleId().

Return values
string

getPdfAction()

public getPdfAction(Document $document[, mixed $fileName = '' ][, CRestServer $restServer = null ][, mixed $hash = '' ]) : null
Parameters
$document : Document
$fileName : mixed = ''
$restServer : CRestServer = null
$hash : mixed = ''
Return values
null

getRequest()

public final getRequest() : HttpRequest
Return values
HttpRequest

getScope()

public final getScope() : string
Return values
string

getSourceParametersList()

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

getUnsignedParameters()

public final getUnsignedParameters() : mixed

isLocatedUnderPsr4()

public final isLocatedUnderPsr4() : bool
Return values
bool

listAction()

public listAction([array<string|int, mixed> $select = ['*'] ][, array<string|int, mixed>|null $order = null ][, array<string|int, mixed>|null $filter = null ][, PageNavigation|null $pageNavigation = null ][, CRestServer|null $restServer = null ]) : Page
Parameters
$select : array<string|int, mixed> = ['*']
$order : array<string|int, mixed>|null = null
$filter : array<string|int, mixed>|null = null
$pageNavigation : PageNavigation|null = null
$restServer : CRestServer|null = null
Return values
Page

listNameActions()

Returns list of all

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

run()

public final run(mixed $actionName, array<string|int, mixed> $sourceParametersList) : HttpResponse|mixed
Parameters
$actionName : mixed
$sourceParametersList : array<string|int, mixed>
Tags
throws
SystemException
Return values
HttpResponse|mixed

setSourceParametersList()

public final setSourceParametersList(array<string|int, mixed> $sourceParametersList) : Controller
Parameters
$sourceParametersList : array<string|int, mixed>
Return values
Controller

showPdfAction()

public showPdfAction(Document $document[, mixed $print = 'y' ][, mixed $pdfUrl = null ][, mixed $width = 700 ][, mixed $height = 900 ][, CRestServer $restServer = null ][, mixed $hash = '' ]) : array<string|int, mixed>|HttpResponse
Parameters
$document : Document
$print : mixed = 'y'
$pdfUrl : mixed = null
$width : mixed = 700
$height : mixed = 900
$restServer : CRestServer = null
$hash : mixed = ''
Return values
array<string|int, mixed>|HttpResponse

updateAction()

public updateAction(Document $document[, array<string|int, mixed> $values = [] ][, int $stampsEnabled = 1 ][, array<string|int, mixed> $fields = [] ][, CRestServer|null $restServer = null ]) : array<string|int, mixed>|null
Parameters
$document : Document
$values : array<string|int, mixed> = []
$stampsEnabled : int = 1
$fields : array<string|int, mixed> = []
$restServer : CRestServer|null = null
Return values
array<string|int, mixed>|null

uploadAction()

public uploadAction(array<string|int, mixed> $fields, CRestServer $restServer) : array<string|int, mixed>|null
Parameters
$fields : array<string|int, mixed>
$restServer : CRestServer
Return values
array<string|int, mixed>|null

        
On this page

Search results