AdminPageFrameworkLoader_AdminPage_Tool_Generator_CustomFieldTypes::_getModifiedFileContents PHP Метод

_getModifiedFileContents() приватный Метод

Converts the class name by adding the user-set class name prefix. Also the text domain used in the custom field type will be converted.
С версии: 3.6.0
С версии: 3.7.2 Added the `$sParsingClassName` argument.
private _getModifiedFileContents ( $sFileContents, $sPathInArchive, $sParsingClassName ) : string
Результат string
    private function _getModifiedFileContents($sFileContents, $sPathInArchive, $sParsingClassName)
    {
        // 3.8.4+ Some custom field types names conflict each other such as `TuneCustomFieldType` and `DateTimeCustomFieldType` so they must be dealt with regular expressions.
        $sFileContents = $this->_getClassNamesPrefixed($sFileContents);
        // Searches and replaces for `str_replace()`.
        $_aSearches = array();
        $_aReplaces = array();
        $_sUserTextDomain = $this->oFactory->oUtil->getElement($_POST, array($this->oFactory->oProp->sOptionKey, 'generator', 'text_domain'), '');
        // Change the text domain.
        /// 3.7.2+ Get the custom field type text domain.
        $_sFieldTypeTextDomain = $this->oFactory->oUtil->getElement($this->aCustomFieldTypes, array($sParsingClassName, 'text_domain'));
        if ($_sFieldTypeTextDomain) {
            $_aSearches[] = $_sFieldTypeTextDomain;
            $_aReplaces[] = $_sUserTextDomain;
        }
        $_aSearches[] = 'admin-page-framework';
        $_aReplaces[] = $_sUserTextDomain;
        // Return the converted string.
        return str_replace($_aSearches, $_aReplaces, $sFileContents);
    }