LeanMapper\Result::getRow PHP Method

getRow() public method

Creates new Row instance pointing to specific row within Result
public getRow ( integer $id = null ) : Row | null
$id integer
return Row | null
    public function getRow($id = null)
    {
        if ($this->isDetached) {
            if ($id !== null) {
                throw new InvalidArgumentException('Argument $id in Result::getRow method cannot be passed when Result is in detached state.');
            }
            $id = self::DETACHED_ROW_ID;
        } elseif ($id === null) {
            throw new InvalidArgumentException('Argument $id in Result::getRow method must be passed when Result is in attached state.');
        }
        if (!isset($this->data[$id])) {
            return null;
        }
        return new Row($this, $id);
    }