Get the name associated with $constant.

@param integer $constant
@return string|boolean The name or false if not found.
544802
public static function getNameByConstant($constant)
    {
        switch ($constant) {
            case self::DEF:
                return 'default';
            break;

            case self::RECT:
                return 'rect';
            break;

            case self::CIRCLE:
                return 'circle';
            break;

            case self::POLY:
                return 'poly';
            break;

            case self::ELLIPSE:
                return 'ellipse';
            break;

            default:
                return false;
            break;
        }
    }
354454
public static function getTypeName($type)
	{
		static $ref = [];
		
		$key = static::class;
		
		if(empty($ref[$key]))
		{
			$ref[$key] = new \ReflectionClass($key);
		}
		
		foreach($ref[$key]->getConstants() as $k => $v)
		{
			if($v === $type && strpos($k, 'T_') === 0)
			{
				return $k;
			}
		}

		return static::UNKNOWN;
	}
664218
public static function getConstantAnnotations($className, $constantName, $annotationClassName = null)
    {
        if(!isset(static::$annotations[$className]['Constants'][$constantName]))
        {
            return [];
        }
        if(null === $annotationClassName)
        {
            return static::$annotations[$className]['Constants'][$constantName];
        }
        else
        {
            $result = [];
            foreach(static::$annotations[$className]['Constants'][$constantName] as $annotation)
            {
                if($annotation instanceof $annotationClassName)
                {
                    $result[] = $annotation;
                }
            }
            return $result;
        }
    }
82583
protected static function getLevelName($value)
    {
        $map = array_flip((new \ReflectionClass(self::class))->getConstants());

        return (array_key_exists($value, $map) ? $map[$value] : null);
    }
918209
public function get(string $optionName)
    {
        $constantName = $this->constantNameFor($optionName);

        if (! defined($constantName)) {
            return null;
        }

        return constant($constantName);
    }
249516
public function name($name = null)
    {
        if (func_num_args() > 0) {
            $this->_name = str_replace(DIRECTORY_SEPARATOR, '/', $name);
        }
        return $this->_name;
    }
489282
public function getName(){
		
		foreach(static::getConstants() as $name => $value){
			if($this->_Value === $value){
				return $name;
			}
		}
		
		return null;
		
	}
1338530
public static function getName($value)
    {
        $enumerables = self::getCache();
        $result = array_search($value, $enumerables, true);
        
        if ($result === false) {
            throw EnumerableException::valueNotFound();
        }
        
        return $result;
    }
37282
public static function get_name($tool) {
        $name = null;

        if (empty($tool->name)) {
            $toolcontext = \context::instance_by_id($tool->contextid);
            $name = $toolcontext->get_context_name();
        } else {
            $name = $tool->name;
        };

        return $name;
    }
863244
private function getConstantValue($constantName)
    {
        $serviceLocator = $this->getServiceLocator();
        if (!$serviceLocator instanceof ServiceLocatorInterface) {
            throw new common_exception_Error();
        }

        return $serviceLocator->get(common_ext_ExtensionsManager::SERVICE_ID)
            ->getExtensionById('tao')
            ->getConstant($constantName);
    }
949433
public function get_name($usr = null){
    if ( $this->auth ){
      if ( \is_null($usr) ){
        $usr = $this->get_session();
      }
      else if ( str::is_uid($usr) ){
        $mgr = $this->get_manager();
        $usr = $mgr->get_user($usr);
      }
      if ( isset($usr[$this->class_cfg['show']]) ){
        return $usr[$this->class_cfg['show']];
      }
    }
    return false;
  }
1086432
public static function getByName($name)
    {
        $name = (string)$name;
        $class = get_called_class();
        if (isset(self::$instances[$class][$name])) {
            return self::$instances[$class][$name];
        }
        $const = $class . '::' . $name;
        if (!defined($const)) {
            throw new \InvalidArgumentException($const . ' not defined');
        }
        return self::$instances[$class][$name] = new $class(constant($const));
    }
1151726
protected function getName($name)
    {
        $renames = $this->getRenames();

        if (isset($renames[$name])) {
            return $renames[$name];
        }
        return $name;
    }
1229102
public function getOptionNameFromDefinition($constant_name)
    {
        if ($this->strStartsWith($constant_name, "'") && $this->strEndsWith($constant_name, "'")) {
            return trim(trim($constant_name, "'")); // single quote
        } else {
            if ($this->strStartsWith($constant_name, '"') && $this->strEndsWith($constant_name, '"')) {
                return trim(trim($constant_name, '"')); // double quote
            } else {
                return $constant_name;
            }
        }
    }
586637
public function getNameFromFile($filename)
	{
		$i = strrpos($filename, self::getSlash());

		if ($i!== false)
		{

			return substr($filename, $i+1);
		}
		else
		{
			return $filename;
		}
	}
1197323
public static function getNameByConstant($constant)
    {
        switch ($constant) {
            case self::AUTHOR:
                return 'author';
            break;

            case self::CANDIDATE:
                return 'candidate';
            break;

            case self::PROCTOR:
                return 'proctor';
            break;

            case self::SCORER:
                return 'scorer';
            break;

            case self::TEST_CONSTRUCTOR:
                return 'testConstructor';
            break;

            case self::TUTOR:
                return 'tutor';
            break;

            default:
                return false;
            break;
        }
    }
1025745
public function getName($withoutPrefix = false)
    {
        $name = $this->name;
        if ($withoutPrefix && stripos($name, $this->dbPrefix) === 0) {
            $name = substr($name, strlen($this->dbPrefix));
        }

        return $name;
    }