protected function bindContext($object = NULL)
	{
		if($object !== NULL && !is_object($object))
		{
			throw new \InvalidArgumentException(sprintf('Expecting an object, given %s', gettype($object)));
		}
	
		$previous = $this->context;
		$this->context = $object;
	
		if($object === NULL)
		{
			$this->proxies = new \SplObjectStorage();
			
			return $previous;
		}
		
		if($this->contextualInstances->offsetExists($object))
		{
			$this->proxies = $this->contextualInstances[$object];
		}
		else
		{
			$this->proxies = new \SplObjectStorage();
			$this->contextualInstances[$object] = $this->proxies;
		}
	
		return $previous;
	}
protected function bindContext($object = NULL)
	{
		if($object !== NULL && !is_object($object))
		{
			throw new \InvalidArgumentException(sprintf('Expecting an object, given %s', gettype($object)));
		}
	
		$previous = $this->context;
		$this->context = $object;
	
		if($object === NULL)
		{
			$this->proxies = new \SplObjectStorage();
			
			return $previous;
		}
		
		if($this->contextualInstances->offsetExists($object))
		{
			$this->proxies = $this->contextualInstances[$object];
		}
		else
		{
			$this->proxies = new \SplObjectStorage();
			$this->contextualInstances[$object] = $this->proxies;
		}
	
		return $previous;
	}
protected function bindContext ( $ object = NULL ) { if ( $ object !== NULL && ! is_object ( $ object ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Expecting an object, given %s' , gettype ( $ object ) ) ) ; } $ previous = $ this -> context ; $ this -> context = $ object ; if ( $ object === NULL ) { $ this -> proxies = new \ SplObjectStorage ( ) ; return $ previous ; } if ( $ this -> contextualInstances -> offsetExists ( $ object ) ) { $ this -> proxies = $ this -> contextualInstances [ $ object ] ; } else { $ this -> proxies = new \ SplObjectStorage ( ) ; $ this -> contextualInstances [ $ object ] = $ this -> proxies ; } return $ previous ; }
Bind the scope to the given object.

@param object $object
@return object The previous context or NULL when the scope was not active.
Bind the scope to the given object .