@param $shortName

@return string
770121
public static function getSDKClassName($shortName)
        {
            if (0 === strpos($shortName, '\\')) {
                return $shortName;
            }

            // replace underscores with namespace marker, PSR-0 style
            $psr0name = str_replace('_', '\\', $shortName);
            if (false === strpos($psr0name, '\\')) {
                $psr0name .= '';
            }

            return '\\UniApi\\'.$psr0name.'\\'.$psr0name;
        }
99120
public static function generate_shortname($data, $templateshortname) {
        if (empty($templateshortname) && !is_numeric($templateshortname)) {
            return null;
        }
        if (strpos($templateshortname, '%') === false) {
            return $templateshortname;
        }

        $course = (object) $data;
        $fullname   = isset($course->fullname) ? $course->fullname : '';
        $idnumber   = isset($course->idnumber) ? $course->idnumber  : '';

        $callback = partial(array('tool_uploadcourse_helper', 'generate_shortname_callback'), $fullname, $idnumber);
        $result = preg_replace_callback('/(?<!%)%([+~-])?(\d)*([fi])/', $callback, $templateshortname);

        if (!is_null($result)) {
            $result = clean_param($result, PARAM_TEXT);
        }

        if (empty($result) && !is_numeric($result)) {
            $result = null;
        }

        return $result;
    }
809424
public static function get_short_fqdn_from_domain($domain)
    {
        \FileLogger::debug('Calling get_short_fqdn_from_email with email domain = '.$domain);
        $ent_arr = explode('.', $domain);
        //remove last element
        array_pop($ent_arr);
        return implode('.', $ent_arr);
    }
373195
public static function getDeliveryShortName($className)
    {
        if (0 === strpos($className, '\\')) {
            $className = substr($className, 1);
        }
        if (0 === strpos($className, 'Boxberry\\')) {
            return trim(str_replace('\\', '_', substr($className, 8, -7)), '_');
        }

        return '\\' . $className . '\\Delivery';
    }
540962
public static function __($short, $chunks){
		$translated = self::_($short);
		foreach($chunks as $k=>$v){
			$translated = str_replace('%'.$k.'%', $v, $translated);
			}
		return $translated;
		}
469026
private function _getShortClassname()
    {
        if( $this->_shortClassName )
            return $this->_shortClassName;

        $this->_shortClassName = substr( $this->_getFullClassname(), strrpos( $this->_getFullClassname(), '\\' ) + 1 );

        return $this->_shortClassName;
    }
821671
public function get_context_name($withprefix = true, $short = false) {
        global $DB;

        $name = '';
        if ($user = $DB->get_record('user', array('id'=>$this->_instanceid, 'deleted'=>0))) {
            if ($withprefix){
                $name = get_string('user').': ';
            }
            $name .= fullname($user);
        }
        return $name;
    }
783552
function toString( $short = false )
    {
        if ( $short )
            $str = $this->Locale->formatShortDate( $this->Date );
        else
            $str = $this->Locale->formatDate( $this->Date );
        return $str;
    }
742118
public function getLabel($short = false)
    {
        if (!$this->label) {
            $this->label = $this->generateLabel();
            if ($this->hasShortLabel()) {
                $this->label_short = $this->generateLabelShort();
            }
        }

        return $short ? $this->label_short : $this->label;
    }
400970
protected function getShortcodeData()
    {
        if($this->shortcodedata){
            return $this->shortcodedata;
        }
        $data = false;
        if($shortcode = $this->request->requestVar('Shortcode')){
            //remove BOM inside string on cursor position...
            $shortcode = str_replace("\xEF\xBB\xBF", '', $shortcode);
            $data = singleton('\Silverstripe\Shortcodable\ShortcodableParser')->the_shortcodes(array(), $shortcode);
            if(isset($data[0])){
                $this->shortcodedata = $data[0];
                return $this->shortcodedata;
            }
        }
    }
1336327
public TagInfo getTag(String shortname) {
        TagInfo tags[] = getTags();

        if (tags == null || tags.length == 0) {
            return null;
        }

        for (int i=0; i < tags.length; i++) {
            if (tags[i].getTagName().equals(shortname)) {
                return tags[i];
            }
        }
        return null;
    }
669429
public static function increment_shortname($shortname) {
        global $DB;
        do {
            $matches = array();
            if (!preg_match('/(.*?)([0-9]+)$/', $shortname, $matches)) {
                $newshortname = $shortname . '_2';
            } else {
                $newshortname = $matches[1] . ($matches[2]+1);
            }
            $shortname = $newshortname;
        } while ($DB->record_exists('course', array('shortname' => $shortname)));
        return $shortname;
    }
1200375
public function getExtends($short = false)
    {
        $extends = '';
        if ($this->isArray()) {
            $extends = $this->getGenerator()->getOptionStructArrayClass();
        } elseif (!$this->isRestriction()) {
            $extends = $this->getGenerator()->getOptionStructClass();
        }
        return $short ? Utils::removeNamespace($extends) : $extends;
    }
1345991
public static String shortName(User user) {
    if (!isEmpty(user.getFirstName()))
      return user.getFirstName();

    if (!isEmpty(user.getLastName()))
      return user.getLastName();

    return user.getUserName();
  }
1325926
public static function check_shortname_available($shortname) {
        global $DB;
        $fullname = $DB->get_field('course', 'fullname',
                array('shortname' => $shortname), IGNORE_MISSING);
        if ($fullname !== false) {
            // I wanted to throw an exception here but it is not possible to
            // use strings from moodle.php in exceptions, and I didn't want
            // to duplicate the string in tool_generator, so I changed this to
            // not use exceptions.
            return get_string('shortnametaken', 'moodle', $fullname);
        }
        return '';
    }
578943
private function getShortName($className)
    {
        if (strpos($className, "\\") === false) {
            return strtolower($className);
        }

        $parts = explode("\\", $className);
        return strtolower(end($parts));
    }
443209
public function getShortcodes()
    {
        $shortcodes = array_map(function ($replacement) {
            return "[{$replacement}]";
        }, $this->replacements);

        return collect(array_combine($shortcodes, $this->replacements));
    }