Resolves an alias into a Delta.

@param string $alias
@param Collection $collection

@return DeltaInterface|null

@throws ResolverException
437703
final public function resolve($alias, Collection $collection)
    {
        $alias = (string) $alias;

        $result = $this->cacheGet($alias, $collection);

        if (false === $result) {
            $result = $this->doResolve($alias, $collection);
            if (null !== $result && !$result instanceof DeltaInterface) {
                throw new ResolverException('Expected result to be either a DeltaInterface object or null.');
            }
            $this->cacheSet($alias, $collection, $result);
        }

        return $result;
    }
878395
public function transform($collection)
    {   
        if (!$collection instanceof Collection) {  
            return null; 
        }
        
        $data = array();
        $accessor = PropertyAccess::createPropertyAccessor();
        
        foreach ($collection as $ref){
            if (!$ref instanceof Select2SortableInterface){
                throw new \InvalidArgumentException('Reference class must be instance of Select2SortableInterface');  
            }
            
            $data[] = $accessor->getValue($ref, $this->inversedProperty)->getId();
        }
        
        $this->collection = $collection;
        
        return implode(',', $data);
    }
856878
public function mapReference($alias)
    {
        //$alias = strval($alias);
        $reference = array_key_exists($alias, $this->aliases);

        if (array_key_exists($alias, $this->aliases)) {
            return $this->aliases[$alias];
        }

        return $alias;
    }
1067948
private function resolve($definition)
    {
        return !is_null($this->resolver) ? $this->resolver->resolve($definition) : $definition;
    }
406790
protected function resolveAlias($key)
	{
		if (isset($this->aliases[$key]))
		{
			return $this->aliases[$key];
		}

		if ($this->parent instanceof Container)
		{
			return $this->parent->resolveAlias($key);
		}

		return $key;
	}
647321
public function resolveClassName($alias)
    {
        // Make sure we have string, type-cast Contenttype if needed.
        $alias = (string) $alias;

        if (class_exists($alias)) {
            return $alias;
        }

        if (array_key_exists($alias, $this->aliases)) {
            $class = $this->aliases[$alias];
            if (class_exists($class)) {
                return $class;
            }
        }
        if (array_key_exists($alias, $this->defaultAliases)) {
            $class = $this->defaultAliases[$alias];
            if (class_exists($class)) {
                return $class;
            }
        }
        if (array_key_exists($alias, $this->defaultAliases)) {
            $class = $this->defaultAliases[$alias];
            if (class_exists($class)) {
                return $class;
            }
        }

        return $this->fallbackEntity;
    }
936904
public function doResolve($alias, Collection $collection)
    {
        foreach ($this->resolvers as $resolver) {
            $result = $resolver->resolve($alias, $collection);
            if ($result !== null) {
                return $result;
            }
        }
        return null;
    }
918254
public function createResultSetMappingBuilder($alias)
    {
        $rsm = new ResultSetMappingBuilder($this->_em, ResultSetMappingBuilder::COLUMN_RENAMING_INCREMENT);
        $rsm->addRootEntityFromClassMetadata($this->_entityName, $alias);

        return $rsm;
    }
776065
public function alias($alias)
    {
        $alias = (string)$alias;
        if (in_array($alias, $this->with)) {
            throw new \InvalidArgumentException("Cannot use alias '{$alias}' because a relation already uses it");
        }

        $this->alias = $alias;

        return $this;
    }
584209
public function getAlias($alias)
    {
        return isset($this->_aliases[$alias]) ? $this->_aliases[$alias] : $alias;
    }
238008
public function alias(string $alias): AliasInterface
    {
        if (!in_array($alias, $this->alias)) {
            $this->alias[] = $alias;
        }
        $this->aliasHelper($alias);

        return $this;
    }
1004722
public function addAlias(string $id, string $alias): ContainerInterface
    {
        $this->registered[] = $alias;
        return $this->container->addAlias($id, $alias);
    }
1185258
public function alias($alias, $value = '')
    {
        // set
        if ($alias && $value) {
            $this->aliasAndValueCheck($alias, $value);
            $this->aliases[$alias] = trim($value);

            // get
        } else {
            return $this->resolveAlias($alias);
        }

        return $this;
    }
53122
public function hasTableAlias($alias)
    {
        return $this->hasAlias($alias) && $this->getExpression($this->getHash($alias)) instanceof Expr\Table;
    }
614568
public function children($lang='',$alias=''){
		$collname=$this->collectionName;
		$bitems=$collname::GetInstance();
		$children=$bitems->itemsFilter(array('parent'=>$this->id));
		if(empty($alias)){
			return $children;
			}
		foreach($children as $ch){
			$chalias=$ch->getalias($lang);
			if($chalias==$alias){
				return $ch;
				}
			}
		return NULL;
		}
936835
protected function resolvePatternAlias($alias)
	{
		if (isset($this->patterns[$alias]) and $class = $this->patterns[$alias]->resolve($alias))
		{
			return $class;
		}

		foreach ($this->patterns as $resolver)
		{
			if ($class = $resolver->resolve($alias))
			{
				return $class;
			}
		}

		return false;
	}
1002142
public function resolveAlias(string $alias)
    {
        if (isset($this->aliases[$alias]))
            return $this->aliases[$alias];

        if (empty($this->parent_scope))
            return null;

        return $this->parent_scope->resolveAlias($alias);
    }