Ouzo\Db\ModelResultSetConverter::extractModelFromResult PHP Method

extractModelFromResult() private method

private extractModelFromResult ( $metaInstance, array $row, $offsetInResultSet )
$row array
    private function extractModelFromResult($metaInstance, array $row, $offsetInResultSet)
    {
        $attributes = array();
        $offset = $offsetInResultSet;
        $hasAnyNonEmptyAttribute = false;
        foreach ($metaInstance->_getFields() as $field) {
            $attributes[$field] = $row[$offset];
            $hasAnyNonEmptyAttribute = $hasAnyNonEmptyAttribute || $row[$offset];
            $offset++;
        }
        return $hasAnyNonEmptyAttribute ? $metaInstance->newInstance($attributes) : null;
    }