Adds column types in array's keys

@param mixed[] $data With keys as column names

@return mixed[] With keys including the column type
343622
final public static function addColumnTypeKeys(array $data)
    {
        $columns = self::getTypedColumns(array_keys($data));
        return array_combine($columns, array_merge($columns, $data));
    }
1197121
public function insert(array $data)
    {
        $params = array();
        $query = "INSERT INTO $this->_name (";

        foreach ($data as $key => $value) {
            $query .= "$key, ";

        }

        $query = substr($query, 0, -2);
        $query .= ") VALUES (";

        $iValue = 0;
        foreach ($data as $key => $value) {
            $query .= ":value$iValue, ";
            $params[":value$iValue"] = $value;
            $iValue++;
        }

        $query = substr($query, 0, -2);
        $query .= ")";

        return $this->_insert($query, $params);
    }
1283792
protected function asArray($data)
	{
		$array = array();

		if (is_object($data))
		{
			$data = get_object_vars($data);
		}

		foreach ($data as $k => $v)
		{
			if (is_object($v) || is_array($v))
			{
				$array[$k] = $this->asArray($v);
			}
			else
			{
				$array[$k] = $v;
			}
		}

		return $array;
	}
935137
public function data(array $data)
    {
        $this->columns(array_keys($data))->values(array_values($data));

        return $this;
    }
978130
private function setProperties(array $data)
    {
        foreach ($data as $key => $value) {
            $this->setProperty($key, $value);
        }

        return $this;
    }
1339267
private function getColumns($data)
        {
            $cols = [];

            foreach ($data[0] as $key => $value) {
                if (is_numeric($key)){
                    if (is_string($data[1][$key])) {
                        $cols[] = ['id' => '', 'label' => $value, 'type' => 'string'];
                    } else {
                        $cols[] = ['id' => '', 'label' => $value, 'type' => 'number'];
                    }

                    $this->_skipFirstRow = true;
                } else {
                    if (is_string($value)) {
                        $cols[] = ['id' => '', 'label' => $key, 'type' => 'string'];
                    } else {
                        $cols[] = ['id' => '', 'label' => $key, 'type' => 'number'];
                    }
                }
            }

            return $cols;
        }
521380
public function filterColumns(array $data) {
        $testCols = array_fill_keys($this->info(Zend_Db_Table_Abstract::COLS), null);
        return array_intersect_key($data, $testCols);
    }
1178363
private function addFilesList($data)
    {
        foreach ($this->_FILES['data']['name'] as $key => $filenames) {
            if (!array_key_exists($key, $data)) {
                $data[$key] = array();
            }

            foreach ($filenames as $file => $filedata) {
                $data[$key][$file] = $this->file("$key.$file");
            }
        }

        return $data;
    }
1041503
private function _getSecondaryKeys($data, $key = null)
    {
        if ($key) {
            $data = ArrayHelper::getValue($data, $key, []);
        }

        return ArrayHelper::getColumn($data, $this->relSecondaryKey);
    }
8786
public function insert(array $data) : array
    {
        $table = $this->definition->getName();
        $columns = $this->definition->getFullColumns();
        $insert = [];
        foreach ($data as $column => $value) {
            if (isset($columns[$column])) {
                $insert[$column] = $this->normalizeValue($columns[$column], $value);
            }
        }
        if (!count($insert)) {
            throw new DBException('No valid columns to insert');
        }
        $sql = 'INSERT INTO '.$table.' ('.implode(', ', array_keys($insert)).') VALUES (??)';
        $par = [$insert];
        $primary = $this->definition->getPrimaryKey();
        if (!count($primary)) {
            $this->db->query($sql, $par);
            return [];
        }
        if ($this->db->driverName() === 'oracle') {
            $ret = [];
            foreach ($primary as $k) {
                $ret[$k] = str_repeat(' ', 255);
                $par[] = &$ret[$k];
            }
            $sql .= ' RETURNING ' . implode(',', $primary) . ' INTO ' . implode(',', array_fill(0, count($primary), '?'));
            $this->db->query($sql, $par);
            return $ret;
        } else {
            $ret = [];
            $ins = $this->db->query($sql, $par)->insertID();
            foreach ($primary as $k) {
                $ret[$k] = $data[$k] ?? $ins;
            }
            return $ret;
        }
    }
1160319
protected function mapAttributes(array &$data)
    {
        $map = $this->attributeMap;
        $out = [];

        foreach ($data as $key => &$value) {
            if (isset($map[$key])) {
                $key = $map[$key];
            }
            $out[$key] = $value;
        }

        return $out;
    }
332577
protected static function buildColumn($data)
    {
        $counter = 0;
        $insertQuery = "";
        $arraySize = count($data);

        foreach ($data as $key => $value)
        {
            $counter++;
            $insertQuery .= self::sanitize($key);
            if($arraySize > $counter)
                $insertQuery .= ", ";
        }
        return $insertQuery;
    }
605605
public function normalizeData(array $data): array
    {
        $normalizedMetaData = [];
        foreach ($data as $key => $value) {
            $normalizedKey = strtolower($key);
            $normalizedValue = $this->normalizeValues($normalizedKey, $value);
            $normalizedMetaData[$normalizedKey] = $normalizedValue;
        }

        return $normalizedMetaData;
    }
648985
public function keyDiff($data) {

		if (! is_array($data)) {
			$data = $this->makeArray($data);
		}
		
		return new static(array_diff_key($this->_data, $data));
	}
1103266
public static function createFromArray(array $data)
    {
        $self = new self();

        foreach ($data as $searchResult) {
            $self->addSearchResult(KeySearchResult::createFromArray($searchResult));
        }

        return $self;
    }
980422
private function addCommonPropertiesFromArray(array $data)
    {
        $k                 = array_keys($data);
        $k                 = $k[0];
        $this->_result[$k] = [];
        foreach ($data[$k] as $c) {
            $id = $c['_id'];
            unset($c['_id']);
            $this->_result[$k][$id] = $c;
        }
    }
797345
private function addVerticesFromArray(array $data)
    {
        $_documentClass = $this->_documentClass;

        $this->_result[] = $_documentClass::createFromArray($data, $this->_options);
    }