public function getById($id)
    {
        if (isset($this->elements[$id])) {
            return $this->elements[$id];
        }

        throw new \InvalidArgumentException(sprintf('Element for id %s does not exist', $id));
    }
public function getById($id)
    {
        if (isset($this->elements[$id])) {
            return $this->elements[$id];
        }

        throw new \InvalidArgumentException(sprintf('Element for id %s does not exist', $id));
    }
public function getById ( $ id ) { if ( isset ( $ this -> elements [ $ id ] ) ) { return $ this -> elements [ $ id ] ; } throw new \ InvalidArgumentException ( sprintf ( 'Element for id %s does not exist' , $ id ) ) ; }
Get an entity by its ID

@param $id

@return EntityAbstract

@throws \InvalidArgumentException
Get an entity by its ID