Return a well known object from the registry

@param string $className A unified namespace class name

@return mixed
541286
protected static function getObject($className)
    {
        if (!isset(self::$instances[$className])) {
            self::$instances[$className] = self::createObject($className);
        }

        return self::$instances[$className];
    }
58410
public static function getClassName($className)
    {
        if (is_object($className)) {
            $className = get_class($className);
        }
        $className = array_slice(explode('\\', $className), - 1);
        return $className[0];
    }
1371822
public function getInstance($className)
    {
        switch ($className) {
            case '\\Zepi\\Api\\AccessControl\\Manager\\TokenManager':
                if ($this->tokenManager === null) {
                    $this->tokenManager = $this->framework->initiateObject($className);
                }
                
                return $this->tokenManager;
            break;
            
            default: 
                return $this->framework->initiateObject($className);
            break;
        }
    }
222509
public static function getOnlyClass($className)
    {
        // Try to find namespace separator
        if (($p = strrpos($className, self::NS_SEPARATOR)) !== false) {
            $className = substr($className, $p + 1);
        }

        return $className;
    }
1180034
public function getMetadataFor($className)
    {
        if (isset($this->mapping[$className])) {
            return $this->mapping[$className];
        }

        $metadata   = new ClassMetadata();
        $reflection = new ReflectionClass($className);

        $metadata->className      = $reflection->name;
        $metadata->riakProperties = $this->getRiakPropertiesMapping($reflection);

        return $this->mapping[$className] = $metadata;
    }
695864
private function getEntityByClass($className)
    {
        if (!isset($this->entities[ $className ])) {
            $entity                       = new Entity($this, $className);
            $this->entities[ $className ] = $entity;

            $this->metadataDriver->readEntityMetadata($entity);
        }

        return $this->entities[ $className ];
    }
682395
protected function getClassName($className) {
        if (strpos($className, ':') !== false) {
           list($namespaceAlias, $simpleClassName) = explode(':', $className);
           $className = $this->doctrine->getManager()->getConfiguration()
               ->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;
        }
        return $className;
    }
1305002
public function load($className)
    {
        // get namespace of current instance
        $currentNamespace = $this->namespace.$this->namespaceSeparator;

        // get namespace from passed className
        $namespace = substr($className, 0, strlen($currentNamespace));

        // check if requested class must be loaded by this instance of loader
        // this is a good example use case for namespacing which makes sense
        if (
            $this->namespace === null ||
            $currentNamespace === $namespace
        ) {
            $filename = '';
            $lastNamespaceSeparatorPosition = strripos($className, $this->namespaceSeparator);

            if ($lastNamespaceSeparatorPosition !== false) {
                $namespace = substr($className, 0, $lastNamespaceSeparatorPosition);
                $className = substr($className, $lastNamespaceSeparatorPosition + 1);
                $filename  = str_replace(
                    $this->namespaceSeparator,
                    $this->separator,
                    $namespace
                ).$this->separator;
            }

            $filename .= str_replace('_', $this->separator, $className).'.php';
            $path      = $this->getPath();

            if ($path !== null) {
                foreach ($path as $singlePath) {
                    $filename = $singlePath.$this->separator.$filename;
                    if (file_exists($filename)) {
                        include_once $filename;
                        return true;
                    }
                }
            }
        }

        return false;
    }
695708
protected function getObjectManagerName($className)
    {
        $om = $this->registry->getManagerForClass($className);
        foreach ($this->registry->getManagerNames() as $emName=>$omName)
        {
            $instance = $this->registry->getManager($emName);
            if ($instance == $om)
            {
                return $emName;
            }
        }

        throw new \Exception("Object manager for class: $className not found.");
    }
1131557
public function getInstance($className)
    {
        switch ($className) {
            case '\\Zepi\\Core\\Language\\Manager\\LanguageFileManager':
                if ($this->languageFileManager === null) {
                    $this->languageFileManager = $this->framework->initiateObject($className);
                }
                
                return $this->languageFileManager;
            break;
            
            case '\\Zepi\\Core\\Language\\Manager\\TranslationManager':
                if ($this->translationManager === null) {
                    $this->translationManager = $this->framework->initiateObject($className);
                }
                
                return $this->translationManager;
            break;
            
            default: 
                return $this->framework->initiateObject($className);
            break;
        }
    }
697026
public function getResultsAsObjects($classname)
    {
        $new = array();
        foreach ((array) $this->results as $result) {
            if (is_array($result))
                $new[] = new $classname($result);
            else
                $new[] = $result;
        }
        return $new;
    }
889375
public function loadClass($className) {
        $classFound = $this->composerClassLoader->loadClass($className);
        if (!$classFound && !$this->caseSensitiveClassLoading) {
            $classFound = $this->composerClassLoader->loadClass(strtolower($className));
        }
        return $classFound;
    }
405715
public static function getClassProfile($classname) {
		if (!is_string($classname) || empty($classname)) {
			throw new \InvalidArgumentException("Argument is not a valid class name");
		}
		
		//check if is already stored
		if (array_key_exists($classname, self::$profiles)) {
			return self::$profiles[$classname];
		}
		
		//validate classname
 		if (!class_exists($classname, true)) {
 			throw new \RuntimeException("Class %s could not be found");
 		}
		
		//build profile and return
		self::$profiles[$classname] = new ClassProfile($classname);
		return self::$profiles[$classname];
	}
1320788
public static function instantiate($className)
    {
        $objectManager = self::get()->getObjectManager();
        $args = func_get_args();

        if (1 === count($args)) {
            return $objectManager->get($className);
        }

        return call_user_func_array([$objectManager, 'get'], $args);
    }
259748
protected function getDatatableInstance($classname)
    {
        if (!class_exists($classname)) {
            return false;
        }
        $datatable  = app($classname);
        $reflection = new ReflectionClass($datatable);
        if (($filename   = $reflection->getFileName()) && !str_contains($filename, 'core')) {
            if (!app('antares.extension')->getActiveExtensionByPath($filename)) {
                return false;
            }
        }
        return $datatable;
    }
911904
public function getElement($className)
    {
        if ($file = $this->findMappingFile($className)) {
            $result = $this->loadMappingFile($file);
            return $result[$className];
        }
        return false;
    }
701402
public static function getClassProfile($classname) {
		if (!array_key_exists($classname, self::$profiles))
			self::$profiles[$classname] = new ClassProfile($classname);
		
		return self::$profiles[$classname];
	}