Bitrix-D7 22.6
 
Загрузка...
Поиск...
Не найдено
Класс Controller
+ Граф наследования:Controller:

Открытые члены

 __construct (Request $request=null)
 
 forward ($controller, string $actionName, array $parameters=null)
 
 getConfigurationOfActions ()
 
 getModuleId ()
 
 isLocatedUnderPsr4 ()
 
 getActionUri (string $actionName, array $params=[], bool $absolute=false)
 
 getUnsignedParameters ()
 
 getCurrentUser ()
 
 setCurrentUser (CurrentUser $currentUser)
 
 convertKeysToCamelCase ($data)
 
 listNameActions ()
 
 configureActions ()
 
 getAutoWiredParameters ()
 
 getPrimaryAutoWiredParameter ()
 
 getDefaultAutoWiredParameters ()
 
 getRequest ()
 
 getScope ()
 
 setScope ($scope)
 
 getSourceParametersList ()
 
 setSourceParametersList ($sourceParametersList)
 
 run ($actionName, array $sourceParametersList)
 
 finalizeResponse (Response $response)
 
 generateActionMethodName ($action)
 
 redirectTo ($url)
 
 getErrors ()
 
 getErrorByCode ($code)
 
 getErrors ()
 
 getErrorByCode ($code)
 
 configureActions ()
 

Открытые статические члены

static className ()
 
static getFullEventName ($eventName)
 

Открытые атрибуты

const SCOPE_REST = 'rest'
 
const SCOPE_AJAX = 'ajax'
 
const SCOPE_CLI = 'cli'
 
const EVENT_ON_BEFORE_ACTION = 'onBeforeAction'
 
const EVENT_ON_AFTER_ACTION = 'onAfterAction'
 
const ERROR_REQUIRED_PARAMETER = 'MAIN_CONTROLLER_22001'
 
const ERROR_UNKNOWN_ACTION = 'MAIN_CONTROLLER_22002'
 
const EXCEPTION_UNKNOWN_ACTION = 22002
 
- Открытые атрибуты унаследованные от Controllerable
const METHOD_ACTION_SUFFIX = 'Action'
 

Защищенные члены

 init ()
 
 getFilePath ()
 
 processUnsignedParameters ()
 
 getSaltToUnsign ()
 
 writeToLogException (\Throwable $e)
 
 collectDebugInfo ()
 
 logDebugInfo ()
 
 prepareParams ()
 
 processBeforeAction (Action $action)
 
 shouldDecodePostData (Action $action)
 
 decodePostData ()
 
 triggerOnBeforeAction (Action $action)
 
 processAfterAction (Action $action, $result)
 
 triggerOnAfterAction (Action $action, $result)
 
 create ($actionName)
 
 buildActionInstance ($actionName, array $config)
 
 existsAction ($actionName)
 
 getDefaultPreFilters ()
 
 getDefaultPostFilters ()
 
 buildFilters (array $config=null)
 
 appendFilters (array $filters, array $filtersToAppend)
 
 removeFilters (array $filters, array $filtersToRemove)
 
 detachFilters (Action $action)
 
 detachPreFilters (Action $action)
 
 detachPostFilters (Action $action)
 
 getActionConfig ($actionName)
 
 setActionConfig ($actionName, array $config=null)
 
 runProcessingThrowable (\Throwable $throwable)
 
 runProcessingException (\Exception $e)
 
 runProcessingError (\Error $error)
 
 runProcessingBinderThrowable (BinderArgumentException $e)
 
 buildErrorFromException (\Exception $e)
 
 buildErrorFromPhpError (\Error $error)
 
 runProcessingIfUserNotAuthorized ()
 
 runProcessingIfInvalidCsrfToken ()
 
 addError (Error $error)
 
 addErrors (array $errors)
 

Защищенные данные

 $errorCollection
 
 $request
 
Configurator $configurator
 

Подробное описание

См. определение в файле controller.php строка 30

Конструктор(ы)

◆ __construct()

__construct ( Request  $request = null)

Constructor Controller.

Аргументы
Request | null$request

Переопределяется в Tracking.

См. определение в файле controller.php строка 83

Методы

◆ addError()

addError ( Error  $error)
protected

Adds error to error collection.

Аргументы
Error$errorError.
Возвращает
$this

См. определение в файле controller.php строка 1039

◆ addErrors()

addErrors ( array  $errors)
protected

Adds list of errors to error collection.

Аргументы
Error[]$errorsErrors.
Возвращает
$this

См. определение в файле controller.php строка 1052

◆ appendFilters()

appendFilters ( array  $filters,
array  $filtersToAppend 
)
finalprotected

См. определение в файле controller.php строка 808

◆ buildActionInstance()

buildActionInstance (   $actionName,
array  $config 
)
finalprotected
См. также
Action::__construct

См. определение в файле controller.php строка 671

◆ buildErrorFromException()

buildErrorFromException ( \Exception  $e)
protected

См. определение в файле controller.php строка 991

◆ buildErrorFromPhpError()

buildErrorFromPhpError ( \Error  $error)
protected

См. определение в файле controller.php строка 1001

◆ buildFilters()

buildFilters ( array  $config = null)
finalprotected

Builds filter by config. If there is no config, then we use default filters

См. также
\Bitrix\Main\Engine\Controller::getDefaultPreFilters() and
\Bitrix\Main\Engine\Controller::getDefaultPostFilters(). If now is POST query and there is no csrf check in config, then we add it.
Аргументы
array | null$config
Возвращает
array|null

См. определение в файле controller.php строка 747

◆ className()

static className ( )
staticfinal

Returns the fully qualified name of this class.

Возвращает
string

См. определение в файле controller.php строка 74

◆ collectDebugInfo()

collectDebugInfo ( )
finalprotected

Collects debug info by Diag.

Возвращает
void

См. определение в файле controller.php строка 508

◆ configureActions()

◆ convertKeysToCamelCase()

convertKeysToCamelCase (   $data)

Converts keys of array to camel case notation.

См. также
\Bitrix\Main\Engine\Response\Converter::OUTPUT_JSON_FORMAT
Аргументы
mixed$dataData.
Возвращает
array|mixed|string

См. определение в файле controller.php строка 280

◆ create()

create (   $actionName)
protected

Переопределяется в ComponentController и Base.

См. определение в файле controller.php строка 638

◆ decodePostData()

decodePostData ( )
finalprotected

См. определение в файле controller.php строка 545

◆ detachFilters()

detachFilters ( Action  $action)
finalprotected

См. определение в файле controller.php строка 880

◆ detachPostFilters()

detachPostFilters ( Action  $action)
finalprotected

См. определение в файле controller.php строка 901

◆ detachPreFilters()

detachPreFilters ( Action  $action)
finalprotected

См. определение в файле controller.php строка 886

◆ existsAction()

existsAction (   $actionName)
finalprotected

См. определение в файле controller.php строка 696

◆ finalizeResponse()

finalizeResponse ( Response  $response)

Finalizes response. 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.

Аргументы
Response$response
Возвращает
void

См. определение в файле controller.php строка 612

◆ forward()

forward (   $controller,
string  $actionName,
array  $parameters = null 
)
Аргументы
Controller | string$controller
string$actionName
array | null$parameters
Возвращает
HttpResponse|mixed
Исключения
SystemException

См. определение в файле controller.php строка 102

◆ generateActionMethodName()

generateActionMethodName (   $action)
final

См. определение в файле controller.php строка 633

◆ getActionConfig()

getActionConfig (   $actionName)
finalprotected

См. определение в файле controller.php строка 916

◆ getActionUri()

getActionUri ( string  $actionName,
array  $params = [],
bool  $absolute = false 
)
final

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

Аргументы
string$actionNameAction name. It's a relative action name without controller name.
array$paramsParameters for creating uri.
bool$absolute
Возвращает
Uri

См. определение в файле controller.php строка 199

◆ getAutoWiredParameters()

getAutoWiredParameters ( )
Возвращает
Parameter[]

Переопределяется в Basket и FileUploader.

См. определение в файле controller.php строка 318

◆ getConfigurationOfActions()

getConfigurationOfActions ( )
final
Возвращает
array|null

См. определение в файле controller.php строка 142

◆ getCurrentUser()

getCurrentUser ( )
final
Возвращает
CurrentUser

См. определение в файле controller.php строка 260

◆ getDefaultAutoWiredParameters()

getDefaultAutoWiredParameters ( )
final
Возвращает
Parameter[]

См. определение в файле controller.php строка 334

◆ getDefaultPostFilters()

getDefaultPostFilters ( )
protected

Returns default post-filters for action.

Возвращает
array

См. определение в файле controller.php строка 732

◆ getDefaultPreFilters()

getDefaultPreFilters ( )
protected

Returns default pre-filters for action.

Возвращает
array

Переопределяется в Mode, ProductForm, ProductSelector, SkuTree, StoreSelector, DefaultElement, Element, Disk, Import, Message, Cookies, DiskFile, Landing, Note, Address, Format, Location, Source, UserFieldConfig, JsonController, BaseReceiver, Application, Configuration, Import, File, ConsentPreview, Base, EntitySelector, Feedback и FileUploader.

См. определение в файле controller.php строка 717

◆ getErrorByCode()

getErrorByCode (   $code)
final

Getting once error with the necessary code.

Аргументы
string$codeCode of error.
Возвращает
Error

Замещает Errorable.

См. определение в файле controller.php строка 1073

◆ getErrors()

getErrors ( )
final

Getting array of errors.

Возвращает
Error[]

Замещает Errorable.

См. определение в файле controller.php строка 1063

◆ getFilePath()

getFilePath ( )
finalprotected

См. определение в файле controller.php строка 178

◆ getFullEventName()

static getFullEventName (   $eventName)
staticfinal

См. определение в файле controller.php строка 499

◆ getModuleId()

getModuleId ( )
final

Returns module id. Tries to guess module id by file path and function

См. также
getModuleId().
Возвращает
string

См. определение в файле controller.php строка 153

◆ getPrimaryAutoWiredParameter()

getPrimaryAutoWiredParameter ( )
Возвращает
Parameter|null

Переопределяется в Basket.

См. определение в файле controller.php строка 326

◆ getRequest()

getRequest ( )
final
Возвращает
\Bitrix\Main\HttpRequest

См. определение в файле controller.php строка 347

◆ getSaltToUnsign()

getSaltToUnsign ( )
protected

Tries to find salt from request. It's "c" (component name) in general.

Возвращает
string|null

См. определение в файле controller.php строка 244

◆ getScope()

getScope ( )
final
Возвращает
string

См. определение в файле controller.php строка 355

◆ getSourceParametersList()

getSourceParametersList ( )
final
Возвращает
array

См. определение в файле controller.php строка 375

◆ getUnsignedParameters()

getUnsignedParameters ( )
final
Возвращает
mixed

См. определение в файле controller.php строка 212

◆ init()

init ( )
protected

Initializes controller. This method is invoked at the end of constructor.

Возвращает
void

Переопределяется в Base, ProductSelector, StoreSelector, Address, Format, Source, Base, Export, Grabber, Csv, Csv и Controller.

См. определение в файле controller.php строка 134

◆ isLocatedUnderPsr4()

isLocatedUnderPsr4 ( )
final

См. определение в файле controller.php строка 170

◆ listNameActions()

listNameActions ( )
final

Returns list of all

Возвращает
array

См. определение в файле controller.php строка 289

◆ logDebugInfo()

logDebugInfo ( )
finalprotected

Logs debug info by Diag.

Исключения

Bitrix\Main\SystemException

Возвращает
void

См. определение в файле controller.php строка 517

◆ prepareParams()

prepareParams ( )
protected

Prepare params before process action.

Возвращает
bool

См. определение в файле controller.php строка 525

◆ processAfterAction()

processAfterAction ( Action  $action,
  $result 
)
protected

Common operations after process action. If the method returns void or null it means that we don't want to modify $result.

Аргументы
Action$action
$result
Возвращает
HttpResponse|mixed|void

Переопределяется в UserFieldConfig.

См. определение в файле controller.php строка 601

◆ processBeforeAction()

processBeforeAction ( Action  $action)
protected

Common operations before process action.

Аргументы
Action$action
Возвращает
bool If method will return false, then action will not execute.

Переопределяется в Config, ProductSelector, StoreSelector, Disk, Conference, JitsiLite, Secretary и FileUploader.

См. определение в файле controller.php строка 535

◆ processUnsignedParameters()

processUnsignedParameters ( )
finalprotected

См. определение в файле controller.php строка 217

◆ redirectTo()

redirectTo (   $url)

См. определение в файле controller.php строка 1028

◆ removeFilters()

removeFilters ( array  $filters,
array  $filtersToRemove 
)
finalprotected

См. определение в файле controller.php строка 813

◆ run()

run (   $actionName,
array  $sourceParametersList 
)
final
Аргументы
$actionName
array$sourceParametersList
Возвращает
HttpResponse|mixed
Исключения
SystemException

См. определение в файле controller.php строка 399

◆ runProcessingBinderThrowable()

runProcessingBinderThrowable ( BinderArgumentException  $e)
protected

См. определение в файле controller.php строка 969

◆ runProcessingError()

runProcessingError ( \Error  $error)
protected

См. определение в файле controller.php строка 963

◆ runProcessingException()

runProcessingException ( \Exception  $e)
protected

Runs processing exception.

Аргументы
\Exception$eException.
Возвращает
void

Переопределяется в Base.

См. определение в файле controller.php строка 957

◆ runProcessingIfInvalidCsrfToken()

runProcessingIfInvalidCsrfToken ( )
protected

Runs processing if csrf token is invalid.

Возвращает
void

См. определение в файле controller.php строка 1021

◆ runProcessingIfUserNotAuthorized()

runProcessingIfUserNotAuthorized ( )
protected

Runs processing if user is not authorized.

Возвращает
void

См. определение в файле controller.php строка 1010

◆ runProcessingThrowable()

runProcessingThrowable ( \Throwable  $throwable)
protected

См. определение в файле controller.php строка 936

◆ setActionConfig()

setActionConfig (   $actionName,
array  $config = null 
)
finalprotected

См. определение в файле controller.php строка 929

◆ setCurrentUser()

setCurrentUser ( CurrentUser  $currentUser)
final
Аргументы
CurrentUser$currentUser

См. определение в файле controller.php строка 268

◆ setScope()

setScope (   $scope)
final
Аргументы
string$scope
Возвращает
Controller

См. определение в файле controller.php строка 365

◆ setSourceParametersList()

setSourceParametersList (   $sourceParametersList)
final
Аргументы
array$sourceParametersList
Возвращает
Controller

См. определение в файле controller.php строка 385

◆ shouldDecodePostData()

shouldDecodePostData ( Action  $action)
protected

См. определение в файле controller.php строка 540

◆ triggerOnAfterAction()

triggerOnAfterAction ( Action  $action,
  $result 
)
finalprotected

См. определение в файле controller.php строка 615

◆ triggerOnBeforeAction()

triggerOnBeforeAction ( Action  $action)
finalprotected

Triggers the event {{static::EVENT_ON_BEFORE_ACTION}}

См. также
\Bitrix\Main\Engine\Controller::getFullEventName. This method is invoked right before an action is executed. In case the action should not run, event handler have to return EvenResult with type EventResult::ERROR.
Аргументы
Action$actionAction name.
Возвращает
bool

См. определение в файле controller.php строка 560

◆ writeToLogException()

writeToLogException ( \Throwable  $e)
protected

См. определение в файле controller.php строка 460

Данные класса

◆ $configurator

Configurator $configurator
protected

См. определение в файле controller.php строка 49

◆ $errorCollection

$errorCollection
protected

См. определение в файле controller.php строка 45

◆ $request

$request
protected

См. определение в файле controller.php строка 47

◆ ERROR_REQUIRED_PARAMETER

const ERROR_REQUIRED_PARAMETER = 'MAIN_CONTROLLER_22001'

См. определение в файле controller.php строка 39

◆ ERROR_UNKNOWN_ACTION

const ERROR_UNKNOWN_ACTION = 'MAIN_CONTROLLER_22002'

См. определение в файле controller.php строка 40

◆ EVENT_ON_AFTER_ACTION

const EVENT_ON_AFTER_ACTION = 'onAfterAction'

См. определение в файле controller.php строка 37

◆ EVENT_ON_BEFORE_ACTION

const EVENT_ON_BEFORE_ACTION = 'onBeforeAction'

См. определение в файле controller.php строка 36

◆ EXCEPTION_UNKNOWN_ACTION

const EXCEPTION_UNKNOWN_ACTION = 22002

См. определение в файле controller.php строка 42

◆ SCOPE_AJAX

const SCOPE_AJAX = 'ajax'

См. определение в файле controller.php строка 33

◆ SCOPE_CLI

const SCOPE_CLI = 'cli'

См. определение в файле controller.php строка 34

◆ SCOPE_REST

const SCOPE_REST = 'rest'

См. определение в файле controller.php строка 32