/** * Function includes component.php file thus executing the component. Returns what component.php returns. * * <p>Before include there is some helper variables made available for component.php scope.</p> * <p>Note: component must be inited by initComponent method.</p> * @return mixed * */ protected final function __includeComponent() { /** @noinspection PhpUnusedLocalVariableInspection */ global $APPLICATION, $USER, $DB; if (!$this->__bInited) { return null; } //these vars are used in the component file $arParams =& $this->arParams; $arResult =& $this->arResult; $componentPath = $this->__path; $componentName = $this->__name; $componentTemplate = $this->getTemplateName(); if ($this->__parent) { $parentComponentName = $this->__parent->__name; $parentComponentPath = $this->__parent->__path; $parentComponentTemplate = $this->__parent->getTemplateName(); } else { $parentComponentName = ""; $parentComponentPath = ""; $parentComponentTemplate = ""; } return include $_SERVER["DOCUMENT_ROOT"] . $this->__path . "/component.php"; }