Source registration
Handler for source registration event. Example.
Parameters
Parameters | Description | Available from version |
---|---|---|
$event | \Bitrix\Main\Event variable type. SELECTOR - Class object \Bitrix\Landing\Source\Selector is passed to the variable. |
Returned value
Returns object of class \Bitrix\Main\EventResult
. In case sources aren't returned (no sources within limits, for landing mode):
return new Main\EventResult(Main\EventResult::ERROR, null, 'module_ID');
In case sources are available, returns an array with each element describing a single source (even if module has only a single source):
$result = []; $result[] = [ // description for single source SOURCE_ID ... ]; return new Main\EventResult(Main\EventResult::SUCCESS, $result, 'module_ID');
Array keys:
Key | Description | Available from version |
---|---|---|
SOURCE_ID | ID within module framework. Required. | |
TITLE | Name. Required. | |
TYPE | Settings form type for user filter. Currently supports only the "component" type - \Bitrix\Landing\Source\Selector::SOURCE_TYPE_COMPONENT . | |
SETTINGS | Array with parameters user filter settings (required). You need to pass the following keys for the component:
| |
DATA_SETTINGS | Array with source available fields (required):
| |
DATA_LOADER | Full (with indicated namespace) name for descendant class \Bitrix\Landing\Source\DataLoader, that will pass information about elements. Required. | |
SOURCE_FILTER | Additional (non-customizable) filter for elements. Array, optional. For example, for iblocks contains an iblock ID and access permissions keys. |
See Also
© «Bitrix24», 2001-2024