FOF30\Model\DataModel::getPrefixCasePermutations PHP Метод

getPrefixCasePermutations() защищенный Метод

Returns all lower and upper case permutations of the database prefix
protected getPrefixCasePermutations ( ) : array
Результат array
    protected function getPrefixCasePermutations()
    {
        if (empty(self::$prefixCasePermutations)) {
            $prefix = $this->getDbo()->getPrefix();
            $suffix = '';
            if (substr($prefix, -1) == '_') {
                $suffix = '_';
                $prefix = substr($prefix, 0, -1);
            }
            $letters = str_split($prefix, 1);
            $permutations = array('');
            foreach ($letters as $nextLetter) {
                $lower = strtolower($nextLetter);
                $upper = strtoupper($nextLetter);
                $ret = array();
                foreach ($permutations as $perm) {
                    $ret[] = $perm . $lower;
                    if ($lower != $upper) {
                        $ret[] = $perm . $upper;
                    }
                    $permutations = $ret;
                }
            }
            $permutations = array_merge(array(strtolower($prefix), strtoupper($prefix)), $permutations);
            $permutations = array_map(function ($x) use($suffix) {
                return $x . $suffix;
            }, $permutations);
            self::$prefixCasePermutations = array_unique($permutations);
        }
        return self::$prefixCasePermutations;
    }