Make Update Parameter

@param  array $data
@return array
8310
protected static function makeUpdateParameter($data)
    {
        foreach ($data as $field => $value) {
            $newData[] = "{$field}=:{$field}";
        }

        $newData = implode(",", $newData); // override new data

        return $newData;
    }
1004090
public function insertUpdate(array $data)
    {
        $affected = $this->update($data);
        return $affected ?: $this->insert($data);
    }
840540
public function updateDepartment(array $data)
    {
        $result = $this->httpRaw(self::WECHAT_DEPARTMENT_UPDATE_PREFIX, $data, [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['errcode']) && ($result['errcode'] ? $this->dump([$data,$result,$this->getAccessToken()]) : !$result['errcode']);
    }
971496
protected function _update(array $data)
    {
        $data = $this->_setData($data);
        $pmk = $this->getPrimaryKey();
        unset($data[$pmk]);
        $sql = Sql::createSql($this->getAdapter())->update($this->getTableName());
        $event = new Save([
            'action' => Save::UPDATE,
            'data' => $data,
            'abort' => false
        ]);
        $this->getEventManager()->trigger(Save::BEFORE_SAVE, $this, $event);
        if ($event->abort) {
            return false;
        }
        $sql->set($event->data)
            ->where(["{$pmk} = :id" => [':id' => $this->$pmk]])
            ->execute();
        $this->getEventManager()->trigger(Save::AFTER_SAVE, $this, $event);
        return true;
    }
1288732
public function setData(array $data) {
		$this->data = $data;

		$this->resetFields();

		foreach($data as $name=>$data)
			$this->newField($name, $data);

		$this->updateChilds();

		return $this;
	}
1203386
public function update(array $data) {
        // check if primary key is available
        $prim = $this->_model->info(Zend_Db_Table::PRIMARY);
        if (!is_array($prim)) {
            $prim = array($prim);
        }

        $where = array();
        foreach ($prim as $key) {
            if (!array_key_exists($key, $data)) {
                throw new Garp_Content_Exception('Primary key ' . $key . ' not available in data');
            }
            $where[] = $this->_model->getAdapter()->quoteInto($key . ' = ?', $data[$key]);
            unset($data[$key]);
        }
        $where = implode(' AND ', $where);

        try {
            /**
             * First, see if the user is allowed to update everything
             */
            $this->_checkAcl('update');
        } catch (Garp_Auth_Exception $e) {
            /**
             * If that fails, check if the user is allowed to update her own material
             * AND if the current item is hers.
             */
            $this->_checkAcl('update_own');

            /**
             * Good, the user is allowed to 'update_own'. In that case we have to check if
             * the current item is actually the user's.
             */
            if (!$this->_itemBelongsToUser($data, $where)) {
                throw new Garp_Auth_Exception('You are only allowed to edit your own material.');
            }
        }
        return $this->_model->update($data, $where);
    }
2395
private function prepareRequestParams(array $data)
    {
        $has_resource = false;
        $multipart = [];

        foreach ($data as $key => $value) {
            if (!is_array($value)) {
                $multipart[] = ['name' => $key, 'contents' => $value];
                continue;
            }

            foreach ($value as $multiKey => $multiValue) {
                is_resource($multiValue) && $has_resource = true;
                $multiName = $key . '[' . $multiKey . ']' . (is_array($multiValue) ? '[' . key($multiValue) . ']' : '') . '';
                $multipart[] = ['name' => $multiName, 'contents' => (is_array($multiValue) ? reset($multiValue) : $multiValue)];
            }
        }

        if ($has_resource) {
            return ['multipart' => $multipart];
        }

        return ['form_params' => $data];
    }
1142595
public function update(array $data)
    {
        $id = (int) empty($data['id']) ? 0 : $data['id'];
        if ($id <= 0) {
            throw new Exception('Required field id');
        }
        $person_id = empty($data['person_id']) ? 0 : (int) $data['person_id'];
        unset($data['id'], $data['person_id']);
        return $this->rest->put('people/' .
           ($person_id ? $person_id . '/' : '') .  "$this->action/$id", $data);
    }
1107865
public function update($data = null)
    {
        $fields = $this->getFields();
        $sql1 = '';
        $args = array();
        foreach ($fields as $field) {
            if (in_array($field, $this->updated_at_fileds)) {
                $this->{$field} = now();
            }
            $value = $this->getFieldValue($field, $data);
            if (isset($value) && !$this->isIndex($field)) {
                $args[] = $value;
                $sql1 .= "`$field` = ?, ";
            }
        }
        if (!empty($sql1)) {
            $sql1 = substr($sql1, 0, -2);
            $index = $this->getIndex();
            $indexValue = $this->db->escape_string($this->getFieldValue($index, $data));
            if (!$indexValue) {
                return false;
            }
            $args[] = $indexValue;
            return $this->db->exec("UPDATE `{$this->table_name}` SET $sql1 WHERE `$index` = ?", $args, $this->getCacheId($indexValue));
        }
        return false;
    }
210716
public function updateData(array $data) {
        foreach($data as $name => $value) {
            $this->data[$name] = $value;
        }
    }
555
public function update(array $data)
    {
        return $this->forge->updateMysqlUser($this->serverId, $this->id, $data);
    }
1152291
public function update(array $data)
    {
        if (is_null($this->schema)) {
            throw SystemException::forNoSchema();
        }

        $table = $this->schema->getName();
        $updated = $this->schema->getUpdatedFieldName();

        if ($updated) {
            $data[$updated] = date('Y-m-d H:i:s');
        }

        // we will be using moved, since
        // 'order' is used for sorting
        // if there is moved, the the user
        // attempts to update ordering
        if (isset($data['moved'])) {
            $query = $this->resource
                ->getUpdateQuery($table)
                ->where($data['filters']);

            if (!isset($data['fields'])) {
                $data['fields'] = [];
            }

            // update the update field if any
            if ($updated) {
                $data['fields'][$updated] = "'" . $data[$updated] . "'";
            }

            // add fields to be updated
            foreach ($data['fields'] as $field => $value) {
                $query->set($field, $value);
            }

            // we need to assign as we might end from here
            $results = $this->resource->query($query);
        }

        // if this is for the previous column update only
        // we have nothing to update against a specific
        // column, so we have to go back from here
        if (isset($data['previous_column']) && $data['previous_column']) {
            return [];
        }

        return $this
            ->resource
            ->model($data)
            ->save($table)
            ->get();
    }
310589
public function update(array $data = [])
    {
        $this->parseOptions();

        $this->options['data'] = array_merge($this->options['data'], $data);

        return $this->connection->update($this);
    }
159445
protected function doUpdate(array $data)
    {
        if (empty($data)) {
            throw new InvalidArgumentException('Cannot update an empty record.');
        }

        $bindings = array_merge($this->bindings['join'], $this->bindings['where']);
        $settings = [];
        $values   = [];
        if (empty($bindings) || is_int(key($bindings))) { // Prevent PDO-Error: "Invalid parameter number: mixed named and positional parameters"
            // bindings not used or question mark placeholders used
            foreach ($data as $column => $value) {
                $settings[] = $this->quoteColumn($column) . ' = ?';
                $values[]   = $value;
            }
        }
        else {
            // named placeholders are used
            foreach ($data as $column => $value) {
                $key = $column;
                if (isset($bindings[$key])) {
                    $i = 0;
                    do {
                        $key = $column . '_' . (++$i);
                    } while (isset($bindings[$key]) || isset($data[$key]));
                }
                $settings[] = $this->quoteColumn($column) . ' = :' . $key;
                $values[$key] = $value;
            }
        }

        $from     = ' ' . implode(', ', $this->from);
        $bindings = array_merge($this->bindings['join'], $values, $this->bindings['where']);
        $settings = ' SET ' . implode(', ', $settings);

        $query = 'UPDATE'
            . $from
            . $this->buildJoin()
            . $settings
            . $this->buildWhere();

        return $this->db->exec($query, $bindings);
    }
1022975
public function update(array $data)
    {
        $chatbot = Basecamp::chatbots($this->bucket->id, $this->campfire->id)
                           ->update($this->id, $data);

        $this->setAttributes($chatbot);

        return $chatbot;
    }
273730
protected function prepareData(array $data)
	{
		$data = array_merge(array(
			'name'       => null,
			'email'      => null,
			'username'   => null,
			'id'         => null,
			'text'       => null,
			'ip'         => null,
			'user_agent' => null
		), $data);

		$data['original_text'] = $data['text'];

		if ($this->stringProcessor)
		{
			$data['text'] = $this->stringProcessor->prepare($data['text']);
		}

		return $data;
	}
1340962
function update( $table, $data, $where = array(), $params = array() ) {

        if ( empty( $data ) ) return;

        $set = array();

        foreach ( $data as $column => $value ) {

            $set[] = $this->quoteIdentifier( $column ) . " = " . $this->quote( $value );

        }

        if ( !is_array( $where ) ) $where = array( $where );
        if ( !is_array( $params ) ) $params = array_slice( func_get_args(), 3 );

        $table = $this->rewriteTable( $table );
        $query = "UPDATE " . $this->quoteIdentifier( $table );
        $query .= " SET " . implode( ", ", $set );
        $query .= $this->getSuffix( $where );

        $this->onQuery( $query, $params );

        $statement = $this->prepare( $query );
        $statement->execute( $params );

        return $statement;

    }