Convert array to entity.

@param array $row

@return ModelInterface
161126
protected function rowToObject($row)
    {
        if ('array' == $this->returnDataType) {
            return $row;
        }

        if ($row) {
            $object = $this->createEntity();
            $this->loadObjectFromArray($object, $row);

            return $object;
        }

        return;
    }
201139
public function getRow( $row )
	{
		if( $row < 0 || $row >= $this->getRowNumber() )
			throw new OutOfRangeException( 'Row key "'.$row.'" is not valid.' );
		return new Alg_Math_Algebra_Vector( $this->values[$row] );
	}
77691
private function getObjectResult(array $columns, array $row)
    {
        $obj = new \stdClass();
        foreach ($columns as $key => $column) {
            $obj->{$column} = $row[$key];
        }

        return $obj;
    }
873505
protected function _prepareArrayRow(\Magento\Framework\DataObject $row)
    {
        $options = [];

        $options['option_' . $this->_getAttributeRenderer()->calcOptionHash(
            $row->getData('attribute')
        )]
            = 'selected="selected"';
        $options['option_' . $this->_getConditionsRenderer()->calcOptionHash(
            $row->getData('conditions')
        )]
            = 'selected="selected"';
        $options['option_' . $this->_getValueRenderer()->calcOptionHash(
            $row->getData('cvalue')
        )]
            = 'selected="selected"';

        $row->setData('option_extra_attrs', $options);
    }
174239
protected static function transformRow($row)
    {
        foreach ($row as $key => $value) {
            if ($value instanceof DateTime) {
                $row[$key] = $value->format('Y-m-d H:i:s');
            } else {
                if (is_object($value)) {
                    $row[$key] = (string) $value;
                } else {
                    $row[$key] = $value;
                }
            }
        }

        return $row;
    }
759877
public function castRow($row)
    {
        $outRow = [];
        $validationErrors = [];
        foreach ($this->fields() as $fieldName => $field) {
            $value = array_key_exists($fieldName, $row) ? $row[$fieldName] : null;
            if (in_array($value, $this->missingValues())) {
                $value = null;
            }
            try {
                $outRow[$fieldName] = $field->castValue($value);
            } catch (Exceptions\FieldValidationException $e) {
                $validationErrors = array_merge($validationErrors, $e->validationErrors);
            }
        }
        if (count($validationErrors) > 0) {
            throw new Exceptions\FieldValidationException($validationErrors);
        }

        return $outRow;
    }
701222
public function with($row = null)
    {
        is_array($row) && $row = new Fluent($row);

        if (!is_null($row)) {
            $this->row = $row;
        }

        return $this->row;
    }
1192462
public function getModelNameForRow(array $row)
    {
        if (isset($row['gtf_field_type']) && ('appointment' === $row['gtf_field_type'])) {
            return self::APPOINTMENTS_NAME;
        }
        if ((! isset($row['gtf_field_type'])) && isset($row[$this->_modelField]) && $row[$this->_modelField]) {
            return $row[$this->_modelField];
        }
        return self::FIELDS_NAME;
    }
671148
protected function filterRow(RowInterface $row): RowInterface
    {
        if (empty($this->getFields())) {
            return $row;
        }
        $fields = array_keys($row->toArray());
        $toDelete = array_diff($fields, $this->getFields());

        foreach ($toDelete as $field) {
            unset($row->$field);
        }
        return $row;
    }
777014
public function populate($rows)
    {
        $indexBy = $this->indexBy;

        if ($indexBy === null) {
            return $this->createObjects($rows);
        }
        $result = [];
        foreach ($rows as $row) {
            if (is_string($indexBy)) {
                $key = $row[$indexBy];
            } else {
                $key = call_user_func($indexBy, $row);
            }
            $result[$key] = $this->createObject($row);
        }
        return $result;
    }
623057
private static function createModel( $row )
    {
        $table_name = get_called_class();
        
        $model = new $table_name();
        
        $model->setExists( true );
        
        foreach ( $row as $key => $value )
        {
            if ( !is_int($key) )
            {
                $model->$key = $value;
                $model->_snapshot[$key] = $value;
            }
        }
        
        return $model;
    }
183621
protected function instantiateRowWrapperObject($row)
    {
        if ($this->row_wrapper_class === null) {
            $object = $row;
        } else {
            $object = new $this->row_wrapper_class(
                $row,
                $this->getOption('read_only')
            );
        }

        return $object;
    }
743633
public function createDataObject($row)
    {
        // remove any composed fields
        $add = [];

        if ($this->_compositeExtraFields) {
            foreach ($this->_compositeExtraFields as $fieldName => $composed) {
                // convert joined extra fields into their composite field types.
                $value = [];

                foreach ($composed as $subField) {
                    if (isset($row[$fieldName . $subField])) {
                        $value[$subField] = $row[$fieldName . $subField];

                        // don't duplicate data in the record
                        unset($row[$fieldName . $subField]);
                    }
                }

                $obj = Injector::inst()->create($this->extraFields[$fieldName], $fieldName);
                $obj->setValue($value, null, false);
                $add[$fieldName] = $obj;
            }
        }

        $dataObject = parent::createDataObject($row);

        foreach ($add as $fieldName => $obj) {
            $dataObject->$fieldName = $obj;
        }

        return $dataObject;
    }
67799
public function batchInsert(array $rows): ResultInterface
    {
        $this->insert = $this->getTableName();
        foreach ($rows as $row) {
            ksort($row);
            if (!isset($this->insertValues['columns'])) {
                $this->insertValues['columns'] = array_keys($row);
            }
            $this->insertValues['values'][] = array_values($row);
        }

        return $this->execute();
    }
82604
public function process(array $row)
    {
        foreach ($row as &$item) {
            if (is_bool($item)) {
                $item = $item ? 1 : 0;
            }
        }

        return $row;
    }
218952
public function typecastSaveRow(Model $m, $row)
    {
        if (!$row) {
            return $row;
        }

        $result = [];
        foreach ($row as $key => $value) {

            // Look up field object
            $f = $m->hasElement($key);

            // Figure out the name of the destination field
            $field = $key;

            // We have no knowledge of the field, it wasn't defined, so
            // we will leave it as-is.
            if (!$f) {
                $result[$field] = $value;
                continue;
            }

            $value = $this->typecastSaveField($f, $value);

            // store converted value
            $result[$field] = $value;
        }

        return $result;
    }
1133955
public function loadFromRow($row)
    {
        // Loop over the columns, sanitise and store it into the new properties of this object.
        foreach ($row as $column => &$value) {
            // Only save columns beginning with a normal letter.
            if (preg_match('/^[a-z]/i', $column)) {
                $this->$column = & $value;
            }
        }
        $this->postConstruct();
        if (DatabaseLayer::getInstance()->useCache() && $this->_caching_enabled) {
            $cache = DatabaseLayer::getInstance()->getCache();
            $cache->save($this->getCacheIdentifier(), serialize($this));
        }
        return $this;
    }