eZ\Publish\Core\Base\ServiceContainer::get PHP Method

get() public method

Convenience method to inner container.
public get ( string $id ) : object
$id string
return object
    public function get($id)
    {
        return $this->innerContainer->get($id);
    }

Usage Example

 /**
  * @covers \eZ\Publish\Core\Base\ServiceContainer::__construct
  * @covers \eZ\Publish\Core\Base\ServiceContainer::get
  * @covers \eZ\Publish\Core\Base\ServiceContainer::lookupArguments
  */
 public function testParameters()
 {
     $testPath = "TestValue/Path";
     $sc = new ServiceContainer(array('parameters' => array('storage_path' => $testPath), 'ParameterTest' => array('class' => 'eZ\\Publish\\Core\\Base\\Tests\\ParameterTest', 'arguments' => array('path' => '$storage_path'))));
     $obj = $sc->get('ParameterTest');
     self::assertEquals($testPath, $obj->parameter);
 }