Liip\RMT\Context::getList PHP Method

getList() public method

public getList ( $id )
    public function getList($id)
    {
        if (!isset($this->lists[$id])) {
            throw new \InvalidArgumentException("There is no list defined with id [{$id}]");
        }
        foreach ($this->lists[$id] as $pos => $object) {
            if (is_array($object)) {
                $this->lists[$id][$pos] = $this->instanciateObject($object);
            }
        }
        return $this->lists[$id];
    }

Usage Example

Example #1
0
 /**
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage There is no list defined with id [abc]
  */
 public function testGetListParamWithoutAdd()
 {
     $this->context->getList('abc');
 }