Turn migration names like 'CreateUserTable' into file names like
'12345678901234_create_user_table.php' or 'LimitResourceNamesTo30Chars' into
'12345678901234_limit_resource_names_to_30_chars.php'.

@param string $className Class Name
@return string
779223
public static function mapClassNameToFileName($className)
    {
        $arr = preg_split('/(?=[A-Z])/', $className);
        unset($arr[0]); // remove the first element ('')
        $fileName = static::getCurrentTimestamp() . '_' . strtolower(implode($arr, '_')) . '.php';

        return $fileName;
    }
70878
public static function getMappedClassName($className)
    {
        $mappedName = array_search($className, self::$classMap);

        if ($mappedName) {
            return $mappedName;
        }

        $mappedName = array_search($className, array_flip(self::$classMap));

        if ($mappedName) {
            return $mappedName;
        }

        return false;
    }
974002
public static function getStorageKey($className)
    {
        $key = $className;

        if (!\OxidEsales\Eshop\Core\NamespaceInformationProvider::isNamespacedClass($className)) {
            $bcMap = self::getBackwardsCompatibilityClassMap();
            $key = isset($bcMap[strtolower($key)]) ? $bcMap[strtolower($key)] : strtolower($key);
        }

        return $key;
    }
242222
public static function getCarrierShortName($className)
    {
        if (0 === strpos($className, '\\')) {
            $className = substr($className, 1);
        }

        if (0 === strpos($className, 'Omniship\\')) {
            return trim(str_replace('\\', '_', substr($className, 8, -7)), '_');
        }

        return '\\'.$className;
    }
1266681
public static function inverseTranslate(string $className): string
    {
        // remove the suffix 'Command', then lower case the first letter
        $className = \lcfirst(static::clearSuffix($className));

        return \strtolower(
            \preg_replace('/([A-Z])/', ':\1', $className)
        );
    }
95577
private function getClassNameForTable($tableName)
    {
        return $this->namespace . (
            $this->classNamesForTables[$tableName]
                ?? Inflector::classify(strtolower($tableName))
        );
    }
1341405
public function classname($classname = null)
    {
        if ($classname === null) {
            return $this->classname;
        }

        $this->classname = $classname;
    }
1226775
public static function mapFileNameToClassName($fileName)
    {
        $matches = [];
        if (preg_match(static::MIGRATION_FILE_NAME_PATTERN, $fileName, $matches)) {
            $fileName = $matches[1];
        }

        return str_replace(' ', '', ucwords(str_replace('_', ' ', $fileName)));
    }
566834
protected function removeRootNamespace($classname)
    {
        $namespaces = $this->splitNamespaces($classname);
        if (count($namespaces) > 1) {
            $classname = implode('\\', array_slice($namespaces, 1));
        }

        return $classname;
    }
564983
function convertToClassName($pString)
    {
        // strip off the forward slash and extension.
        $className = \basename($pString, '.php');

        // Camel Case any words left.
        $className = $this->camelCase($className, TRUE);

        return $className;
    }
725187
private function getFullPathFromClassName(string $className): string
  {
    $file_name = str_replace('\\', '/', $className).$this->extension;
    $full_path = $this->resourceDirFullPath.'/'.$file_name;

    return $full_path;
  }
1278365
protected function getClassName($fullClassName)
    {
        if (\mb_strrpos($fullClassName, '\\') === false) {
            return $fullClassName;
        }
        return \mb_substr($fullClassName, \mb_strrpos($fullClassName, '\\') + 1, \mb_strlen($fullClassName));
    }
326023
protected function _classFileHeader($className)
    {
        $header = <<<TEXT
<?php
/**
 * Licensed under The GPL-3.0 License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @since    2.0.0
 * @author   Christopher Castro <chris@quickapps.es>
 * @link     http://www.quickappscms.org
 * @license  http://opensource.org/licenses/gpl-3.0.html GPL-3.0 License
 */

TEXT;

        if ($this->params['fixture']) {
            $header .= <<<TEXT
namespace CMS\Test\Fixture;

use Cake\TestSuite\Fixture\TestFixture;


TEXT;
        }

        $header .= $this->params['fixture'] ? "class {$className} extends TestFixture\n" : "\nclass {$className}\n";

        return $header;
    }
717990
public static function tableize($className)
    {
        $result = self::underscore($className);

        if (!self::isPlural($className)) {
            $result = self::pluralize($result);
        }
        return $result;
    }
977552
public function generateTableName($tableName)
    {
        if (!$this->useTablePrefix) {
            return $tableName;
        }

        $db = $this->getDbConnection();
        if (preg_match("/^{$db->tablePrefix}(.*?)$/", $tableName, $matches)) {
            $tableName = '{{%' . $matches[1] . '}}';
        } elseif (preg_match("/^(.*?){$db->tablePrefix}$/", $tableName, $matches)) {
            $tableName = '{{' . $matches[1] . '%}}';
        }
        return $tableName;
    }
783067
static public function autoload($className)
    {
        $className = ltrim($className, '\\');
        $fileName  = '';
        $namespace = '';
        if ($lastNsPos = strripos($className, '\\')) {
            $namespace = substr($className, 0, $lastNsPos);
            $className = substr($className, $lastNsPos + 1);
            $fileName  = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
        }
        $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';

        require self::$base . $fileName;
    }
419306
public function getProxyFilename($className)
    {
        $baseDirectory = $this->proxyDirectory;
        $suffix = str_replace('\\', '', $className);
        
        if ($this->proxyClassSuffix !== null) {
            $suffix .= $this->proxyClassSuffix;
        }
        
        return rtrim($baseDirectory, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . self::MARKER
            . $suffix . '.php';
    }