XStatic\StaticProxy::setContainer PHP Method

setContainer() public static method

Sets the Container that will be used to retrieve the Proxy Subject
public static setContainer ( Interop\Container\ContainerInterface $container ) : mixed
$container Interop\Container\ContainerInterface The Container that provides the real Proxy Subject
return mixed
    public static function setContainer(ContainerInterface $container)
    {
        static::$container = $container;
    }

Usage Example

Beispiel #1
0
 /**
  * Sets the Container object that provides the actual subjects' instances
  *
  * @param ContainerInterface $container Instance of a Container (or Service Locator)
  *
  * @return $this
  */
 public function setContainer(ContainerInterface $container)
 {
     $this->container = $container;
     StaticProxy::setContainer($this->container);
     return $this;
 }