Determines if a given $identifier is a class property, a class method, a class itself,
or a namespace identifier.

@param string $identifier The identifier to be analyzed
@return string Identifier type. One of `property`, `method`, `class` or `namespace`.
507140
public static function type($identifier) {
		$identifier = ltrim($identifier, '\\');

		if (strpos($identifier, '::')) {
			return (strpos($identifier, '$') !== false) ? 'property' : 'method';
		}
		if (is_readable(Libraries::path($identifier))) {
			if (class_exists($identifier) && in_array($identifier, get_declared_classes())) {
				return 'class';
			}
		}
		return 'namespace';
	}
1037986
public function hasIdentifier($identifier)
    {
        if(!$identifier instanceof ObjectIdentifierInterface) {
            $identifier = $this->getIdentifier($identifier);
        }

        return in_array((string) $identifier, $this->__identifier_list);
    }
221905
public function has($identifier)
    {
        $attributes = $this->getData()->attributes;
        if(isset($attributes[$identifier])) {
            return true;
        }

        return false;
    }
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()));
    }
485231
public function getByIdentifier(Identifier $identifier)
    {
        $className = $identifier->class->getName();
        $mapId     = $identifier->getSerialized();

        return $this->identityMap[$className][$mapId];
    }
965124
public function getClassTemplates(ObjectIdentifier $identifier)
    {
        $templates = array();

        //Identifier
        $component = $this->getObject('object.bootstrapper')
            ->getComponentIdentifier($identifier->package, $identifier->domain);

        //Fallback
        if($namespaces = $this->getIdentifierNamespaces($component))
        {
            foreach($namespaces as $namespace)
            {
                //Handle class prefix vs class namespace
                if(strpos($namespace, '\\')) {
                    $namespace .= '\\';
                }

                $templates[] = $namespace.'<Class>';
                $templates[] = $namespace.'<Package><Path><File>';
            }
        }

        $templates = array_merge($templates, parent::getClassTemplates($identifier));

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

        if (!class_exists($classname)) {
            $classname = AnServiceClass::findDefaultClass($identifier);

            if (!$classname) {
                // use default class instead
                $classname = 'An'.ucfirst($identifier->package).AnInflector::implode($identifier->path).'Default';

                if (!class_exists($classname)) {
                    $classname = false;
                }
            }
        }

        return $classname;
    }
289606
public function parseIdentifier(ObjectIdentifier $identifier)
    {
        $info = parent::parseIdentifier($identifier);

        $path  = $identifier->path;

        //Allow locating default classes if $path is empty.
        if(empty($path))
        {
            $info['path']    = $info['file'];
            $info['file']    = '';
            $info['package'] = '';
        }
        else
        {
            $package = array_shift($path);

            $info['path']    = StringInflector::implode($path);
            $info['package'] = ucfirst($package);
        }

        //Make an exception for 'view' and 'module' types
        if(in_array($info['package'], array('View','Module')) && !in_array('behavior', $path)) {
            $info['path'] = '';
        }

        return $info;
    }
1290264
public function get($identifier)
    {
        if (!isset($this->languages[$identifier])) {
            return null;
        }

        return $this->languages[$identifier];
    }
592411
public static function getComponentWithIdentifier(string $identifier)
    {
        $components = self::getComponents();
        foreach ($components as $component) {
            if (empty($component->getIdentifier())) {
                continue;
            }
            
            if ($component->getIdentifier() == $identifier) {
                return $component;
            }
        }
        
        return null;
    }
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;
    }
139578
public function hasDefinition($identifier)
    {
        return isset($this->definitions[$identifier]) || isset($this->mongoIndex[$identifier]);
    }
48966
public function addIdentifier($identifier)
    {
        if (!isset($this->identifiers[$identifier])) {
            $this->identifiers[$identifier] = $identifier;
        }

        return $this;
    }
619494
public static function getInstance($identifier = self::PRIMARY)
    {
        $serviceClassName = get_called_class();


        return self::findOrCreateInstance($serviceClassName, $identifier);
    }
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;
    }
230200
public function getNodeByIdentifier($identifier)
    {
        $node = $this->firstLevelNodeCache->getByIdentifier($identifier);
        if ($node !== false) {
            return $node;
        }
        $nodeData = $this->nodeDataRepository->findOneByIdentifier($identifier, $this->getWorkspace(), $this->dimensions, $this->removedContentShown);
        if ($nodeData !== null) {
            $node = $this->nodeFactory->createFromNodeData($nodeData, $this);
        } else {
            $node = null;
        }
        $this->firstLevelNodeCache->setByIdentifier($identifier, $node);
        return $node;
    }
929037
public function getType($identifier)
    {
        return isset($this->types[$identifier])? $this->types[$identifier]: null;
    }