Puli\Repository\Resource\Collection\ArrayResourceCollection::get PHP Méthode

get() public méthode

public get ( $key )
    public function get($key)
    {
        if (!isset($this->resources[$key])) {
            throw new OutOfBoundsException(sprintf('The offset "%s" does not exist.', $key));
        }
        return $this->resources[$key];
    }

Usage Example

 /**
  * @expectedException \OutOfBoundsException
  */
 public function testGetFailsIfNoSuchOffset()
 {
     $collection = new ArrayResourceCollection();
     $collection->get(0);
 }