LeanMapper\Result::getReferencedRow PHP Method

getReferencedRow() public method

Creates new Row instance pointing to requested row in referenced Result
public getReferencedRow ( integer $id, string $table, string | null $viaColumn = null, Filtering $filtering = null ) : Row | null
$id integer
$table string
$viaColumn string | null
$filtering Filtering
return Row | null
    public function getReferencedRow($id, $table, $viaColumn = null, Filtering $filtering = null)
    {
        if ($viaColumn === null) {
            $viaColumn = $this->mapper->getRelationshipColumn($this->table, $table);
        }
        $result = $this->getReferencedResult($table, $viaColumn, $filtering);
        $rowId = $this->getDataEntry($id, $viaColumn);
        return $rowId === null ? null : $result->getRow($rowId);
    }