Set an alias for an identifier

@param string  The alias
@param mixed	  An object that implements AnObjectServiceable, AnServiceIdentifier object
or valid identifier string
776427
public static function setAlias($alias, $identifier)
    {
        $identifier = self::getIdentifier($identifier);
        self::$_aliases[$alias] = $identifier;
    }
1051236
protected static function _identifier(AnServiceIdentifier $identifier)
    {
        $identifier = clone $identifier;

        if (!$identifier->name) {
            $identifier->name = AnInflector::singularize($identifier->package);
        }

        $identifier->type = 'com';
        $identifier->path = array('domain','entity');

        return $identifier;
    }
485824
public function setIdentifier($identifier) {

		if(false === is_array($identifier)) {
			$identifier = [$identifier];
		}

		$this -> identifier = $identifier;
	}
1306677
private void addObjectIdentity(final Object object) {

        if (object == null) {
            _buffer.append("null");
        } else {
            _buffer.append(object.getClass().getName());
            _buffer.append("@");
            _buffer
                    .append(Integer
                            .toHexString(System.identityHashCode(object)));
        }

    }
638150
function setNextMapIdent($ident, $multicall = false)
    {
        if (!is_string($ident)) {
            throw new InvalidArgumentException('ident = ' . print_r($ident, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($ident), $multicall);
    }
994147
public function setAliasOf($alias) {
        $alias = $this->normalizeID($alias);

        if ($alias === $this->currentRuleName) {
            trigger_error("You cannot set alias '$alias' to itself.", E_USER_NOTICE);
        } else {
            $this->currentRule['aliasOf'] = $alias;
        }
        return $this;
    }
1046796
protected function setIdentifier(
        $field,
        $identifier,
        $default = null
    )
    {
        if ($default && $identifier === null) {
            $identifier = call_user_func($default);
        }

        if (!($identifier instanceof Identifier)) {
            throw new \InvalidArgumentException('$identifier must be instance of Identifier');
        }

        $this->{$field} = $identifier;
    }
330150
public function assignIdentifier($object, array $identifier) : void
    {
        if (! $object instanceof IdentifiableInterface) {
            throw new InvalidArgumentException(sprintf('%s must implement IdentifiableInterface.', get_class($object)));
        }

        $object->assignIdentifier($identifier);
    }
830858
public static function setAlias($alias)
    {
        if (self::isConfigKeyExist($alias, 'shortcuts')) {
            $shortcuts = self::$config[$alias]['shortcuts'];
            //
            foreach ($shortcuts as $alias => $target) {
                $target = Strings::replace($target, '/', '\\');
                Alias::set($target, $alias);
            }
        }
    }
828462
public static function setIdentifierName(string $identifier): void
    {
        if (empty($identifier)) {
            throw new InvalidArgumentException("Identifier shouldn't be empty.");
        } elseif (\in_array($identifier, ['password'])) {
            throw new InvalidArgumentException("Identifier [{$identifier}] is not allowed!");
        }

        static::$identifier = $identifier;
    }
474893
public function setFrom($table, $alias = null)
    {
        $this->table = $table;
        $this->aliasTable = $alias === null ? $table : $alias;

        return $this;
    }
783743
function alias( $aliasName )
    {
        $aliasList = $this->aliasList();
        if ( !array_key_exists( $aliasName, $aliasList ) )
            return false;
        return $aliasList[$aliasName];
    }
613961
public function addAlias($type, $alias) {
		if (!is_string($type) || empty($type))
			throw new \InvalidArgumentException("Type must be defined as a string");
		
		if (!is_string($alias) || empty($alias))
			throw new \InvalidArgumentException("Alias must be defined as a string");
		
		$this->aliases[$alias] = $type;
	}
348754
public function setClass($identifier, $class)
    {
        $identifier = (string) $identifier;

        if(parent::offsetExists($identifier))
        {
            $data = array(
                'identifier' =>  parent::offsetGet($identifier),
                'class'      =>  $class
            );

            apc_store($this->getNamespace().'-object_'.$identifier, $data);
        }

        return  parent::setClass($identifier, $class);
    }
1192440
public function handleAliasAnnotation($e)
    {
        $annotation = $e->getParam('annotation');
        if (!$annotation instanceof Annotation\Alias) {
            return;
        }
    
        $operationSpec = $e->getParam('operationSpec');
        $operationSpec['aliases'] = (array) $annotation->getAlias();
    }
1210760
public function setIdentifier($identifier)
    {
        if (Format::isIdentifier($identifier, false) === true) {
            $this->identifier = $identifier;
        } else {
            $msg = "The 'identifier' argument must be a valid QTI identifier, '" . $identifier . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
461637
public function setAlias(string $alias, string $value)
    {
        if (0 !== \strpos($alias, '@')) {
            throw new AliasException('Alias should starts with @');
        }
        $this->aliases[$alias] = $value;
    }