Get the classname based on an identifier.

@param 	mixed  		 An identifier object - anahita:[path].name

@return string|false Return object on success, returns FALSE on failure
166308
public function findClass(AnServiceIdentifier $identifier)
    {
        $path = AnInflector::camelize(implode('_', $identifier->path));
        $classname = 'Com'.ucfirst($identifier->package).$path.ucfirst($identifier->name);
        $loader = $this->getService('anahita:loader');
        //Manually load the class to set the basepath
        if (!$loader->loadClass($classname, $identifier->basepath)) {
            //the default can be in either in the default folder
            //be a registered default class
            $classname = AnServiceClass::findDefaultClass($identifier);
            //hack
            if ($classname == 'AnDomainBehaviorDefault') {
                $classname = null;
            }
            if (!$classname) {
                $classname = $this->_findClass($identifier);
            }
        }

        return $classname;
    }
929037
public function getType($identifier)
    {
        return isset($this->types[$identifier])? $this->types[$identifier]: null;
    }
1037598
def get_classname(obj):
    
    if isinstance(obj, javabridge.JB_Object):
        cls = javabridge.call(obj, "getClass", "()Ljava/lang/Class;")
        return javabridge.call(cls, "getName", "()Ljava/lang/String;")
    elif inspect.isclass(obj):
        return obj.__module__ + "." + obj.__name__
    else:
        return get_classname(obj.__class__)
58410
public static function getClassName($className)
    {
        if (is_object($className)) {
            $className = get_class($className);
        }
        $className = array_slice(explode('\\', $className), - 1);
        return $className[0];
    }
199666
protected static function _determineImplClass(Identifier $identifier): string
    {
        switch ($identifier->typeClass()) {
            case Identifier::CLASS_UNIVERSAL:
                return self::_determineUniversalImplClass($identifier->intTag());
            case Identifier::CLASS_CONTEXT_SPECIFIC:
                return ContextSpecificType::class;
            case Identifier::CLASS_APPLICATION:
                return ApplicationType::class;
            case Identifier::CLASS_PRIVATE:
                return PrivateType::class;
        }
        throw new \UnexpectedValueException(
            sprintf("%s %d not implemented.",
                Identifier::classToName($identifier->typeClass()),
                $identifier->tag()));
    }
166594
public function getClassName($name)
    {
        $name = (string)$name;
        if (array_key_exists($name, $this->propertySets)) {
            return $this->propertySets[$name];
        }

        return null;
    }
470595
public function getName(): string
    {
        // Check cache.
        if (null === $this->name) {
            $tokens = $this->getTokenStream();
            // Find class token
            try {
                $loc = $tokens->scan(0, [T_CLASS, T_TRAIT]);
            } catch (\OutOfBoundsException $e) {
                throw new ClassDefinitionNotFoundException('No class is found inside ' . $this->filename . '.', 0, $e);
            }

            // Get the following token
            if ($loc !== null) {
                $loc = $tokens->next($loc);
            }

            // Make sure it is not :: but a name
            if ($loc !== null && $tokens->type($loc) === T_STRING) {
                // Read the name from the token
                $this->name           = $tokens->value($loc);
                $this->class_location = $loc;
            } else {
                // Mark the name as NOT found (in contrast to not initialized)
                $this->name = false;
            }
        }

        // Return the name if a class was found or throw an exception.
        if ($this->name) {
            return $this->name;
        }

        throw new ClassDefinitionNotFoundException('No class is found inside ' . $this->filename . '.');
    }
2430
private function getFullyQualifiedName($class)
    {
        if (class_exists($class)) {
            return $class;
        }

        //determine if class belongs to the default namespace
        if (class_exists($this->defaultNamespace . '\\' . $class)) {
            return $this->defaultNamespace . '\\' . $class;
        }

        //determine if class belongs to current namespace
        if (class_exists($this->currentNamespace . '\\' . $class)) {
            return $this->currentNamespace . '\\' . $class;
        }

        //if not, check imports
        if (isset($this->imports[ $class ])) {
            //determine if class is aliased directly
            $class = $this->imports[ $class ];

        } else if (($nsDelimiter = strpos($class, '\\')) !== false) {
            //if not, determine if class is part of one of the imported namespaces
            $namespace = substr($class, 0, $nsDelimiter);
            if (!isset($this->imports[ $namespace ])) {
                throw new \InvalidArgumentException("Class {$class} is not found");
            }
            $class = $this->imports[ $namespace ] . substr($class, $nsDelimiter);
        }

        //if class still doesn't exist, throw exception
        if (!class_exists($class)) {
            throw new \InvalidArgumentException("Class {$class} is not found");
        }

        return $class;
    }
660627
public function getClassName(string $name) : string
    {
        $name = str_replace("/", "\\", $name);
        $name = explode("\\", $name);
        $name = array_pop($name);
        $name = $this->removeNoneAlpherNumeric($name);
        return $name;
    }
198677
private function getClassName()
    {
        if (null === $this->className) {
            $this->className = get_class($this);
        }

        return $this->className;
    }
1311665
public static function getEntityIdentifier($identifier)
    {
        $identifier = AnService::getIdentifier($identifier);

        if (!$identifier->basepath) {
            $adapters = AnService::get('anahita:loader')->getAdapters();
            $basepath = pick($adapters[$identifier->type]->getBasePath(), ANPATH_BASE);
            $applications = array_flip(AnServiceIdentifier::getApplications());

            if (isset($applications[$basepath])) {
                $identifier->application = $applications[$basepath];
                $identifier->basepath = $basepath;
            }
        }

        return $identifier;
    }
283949
function getName()
  	{
  		$name = $this->_name;

  		if (empty($name)) {
  			$r = null;
  			if (! preg_match( '/Com(.*)/i', get_class( $this ), $r)) {
                throw new AnErrorException(
                    "Can't get or parse the class name ",
                    AnHttpResponse::INTERNAL_SERVER_ERROR
                );
  			}
  			$name = strtolower($r[1]);
  		}

  		return $name;
  	}
1115712
public function findClass(AnServiceIdentifier $identifier)
    {
        $classname = 'Tmpl'.ucfirst($identifier->package).AnInflector::implode($identifier->path).ucfirst($identifier->name);

        if (!$this->getService('anahita:loader')->loadClass($classname, $identifier->basepath)) {
            $classname = AnServiceClass::findDefaultClass($identifier);

            if (!$classname) {
                //$path      = AnInflector::implode($identifier->path);
                $classpath = $identifier->path;
                $classtype = !empty($classpath) ? array_shift($classpath) : '';

                //Create the fallback path and make an exception for views
                $path = ($classtype != 'view') ? ucfirst($classtype).AnInflector::camelize(implode('_', $classpath)) : ucfirst($classtype);

                $classes[] = 'Tmpl'.ucfirst($identifier->package).$path.ucfirst($identifier->name);
                $classes[] = 'Tmpl'.ucfirst($identifier->package).$path.'Default';
                $classes[] = 'ComApplication'.$path.ucfirst($identifier->name);
                $classes[] = 'ComApplication'.$path.'Default';
                $classes[] = 'LibApplication'.$path.ucfirst($identifier->name);
                $classes[] = 'LibApplication'.$path.'Default';
                $classes[] = 'LibBase'.$path.ucfirst($identifier->name);
                $classes[] = 'LibBase'.$path.'Default';
                $classes[] = 'An'.$path.ucfirst($identifier->name);
                $classes[] = 'An'.$path.'Default';

                foreach ($classes as $class) {
                    if ($this->getService('anahita:loader')->loadClass($class, $identifier->basepath)) {
                        $classname = $class;
                        break;
                    }
                }

                if ($classname) {
                    AnServiceClass::setDefaultClass($identifier, $classname);
                }
            }
        }

        return $classname;
    }
670285
public function loadIdentifier($identifier)
    {
        $result = false;

        $identifier = AnService::getIdentifier($identifier);

        //Get the path
        $path = $identifier->filepath;

        if ($path !== false) {
            $result = self::loadFile($path);
        }

        return $result;
    }
1106643
public static function getClassName($object, $toLower = false)
    {
        $className = $object;
        if (is_object($object)) {
            $className = get_class($object);
        }

        $result = $className;
        if (strpos($className, '\\') !== false) {
            $className = explode('\\', $className);
            reset($className);
            $result = end($className);
        }

        if ($toLower) {
            $result = strtolower($result);
        }

        return $result;
    }
991202
public static function classIdentifierByID( $id )
    {
        $identifierHash = array_flip( self::classIdentifiersHash() );

        if ( isset( $identifierHash[$id] ) )
            return $identifierHash[$id];
        else
            return false;
    }
961052
public static function getClassName($object): ?string {
        $validObject = ClassUtil::isValidObject($object);
        if (!$validObject) {
            return null;
        }
        return (new \ReflectionClass($object))->getName();
    }