generateChains
generateChains($strChains, $initEntity, $initKey);
Generates an object tree with the full set of all fields, necessary to generate data retrieval query for each available report field. Static method.
Function parameters
Parameter | Description |
---|---|
$strChains | Description of report fields (returns getColumnList method of the report helper class). |
$initEntity | Report basic entity object. |
$initKey | Empty string during a regular call or a chain context, describing report field during recursive invocation. |
Returned value
Returns an array with object chains that correspond to field description in the $strChains
argument. Returned value can be used to create a tree of all available report fields by the generateColumnTree method.
Examples of use
<?
// Retrieval of report basic entity by calling getEntityName helper class method. $entityName = call_user_func(array($arParams['REPORT_HELPER_CLASS'], 'getEntityName')); // Retrieval of report basic entity fields by calling getColumnList helper class method. $entityFields = call_user_func(array($arParams['REPORT_HELPER_CLASS'], 'getColumnList')); // Retrieval of chain objects array for all fields, available in the report. $chains = CReport::generateChains($entityFields, $entity, ''); // Passing an array of chains into the generateColumnTree method to create a tree with full description of all fields // available in the report. $fieldsTree = CReport::generateColumnTree($chains, $entity, $arParams['REPORT_HELPER_CLASS']);
?>
© «Bitrix24», 2001-2024