protected static function getConfigurationPageIdToUse($pageId)
    {
        $extensionConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class);
        if ($extensionConfiguration->getIsUseConfigurationFromClosestTemplateEnabled()) {
            /** @var $configurationPageResolve ConfigurationPageResolver */
            $configurationPageResolver = GeneralUtility::makeInstance(ConfigurationPageResolver::class);
            $pageId = $configurationPageResolver->getClosestPageIdWithActiveTemplate($pageId);
            return $pageId;
        }
        return $pageId;
    }
protected static function getConfigurationPageIdToUse($pageId)
    {
        $extensionConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class);
        if ($extensionConfiguration->getIsUseConfigurationFromClosestTemplateEnabled()) {
            /** @var $configurationPageResolve ConfigurationPageResolver */
            $configurationPageResolver = GeneralUtility::makeInstance(ConfigurationPageResolver::class);
            $pageId = $configurationPageResolver->getClosestPageIdWithActiveTemplate($pageId);
            return $pageId;
        }
        return $pageId;
    }
protected static function getConfigurationPageIdToUse ( $ pageId ) { $ extensionConfiguration = GeneralUtility :: makeInstance ( ExtensionConfiguration :: class ) ; if ( $ extensionConfiguration -> getIsUseConfigurationFromClosestTemplateEnabled ( ) ) { /** @var $configurationPageResolve ConfigurationPageResolver */ $ configurationPageResolver = GeneralUtility :: makeInstance ( ConfigurationPageResolver :: class ) ; $ pageId = $ configurationPageResolver -> getClosestPageIdWithActiveTemplate ( $ pageId ) ; return $ pageId ; } return $ pageId ; }
This method retrieves the closest pageId where a configuration is located, when this
feature is enabled.

@param int $pageId
@return int
This method retrieves the closest pageId where a configuration is located when this feature is enabled .