Ejemplo n.º 1
0
 /**
  * Set an alias for an identifier
  *
  * @param mixed $identifier An KObjectIdentifier, identifier string or object implementing KObjectInterface
  * @param string $alias     The identifier alias
  * @return KObjectManager
  * @throws KObjectExceptionInvalidIdentifier If the identifier is not valid
  */
 public function registerAlias($identifier, $alias)
 {
     $identifier = $this->getIdentifier($identifier);
     $alias = $this->getIdentifier($alias);
     //Register the alias for the identifier
     $this->__registry->alias($identifier, (string) $alias);
     //Merge alias configuration into the identifier
     $identifier->getConfig()->append($alias->getConfig());
     // Register alias mixins.
     foreach ($alias->getMixins() as $mixin) {
         $this->registerMixin($identifier, $mixin);
     }
     return $this;
 }