Update action

@param array $data
@return int
190886
public function update(array $data = [])
    {
        $sql = 'update `' . $this->table . '` set ';
        $sql .= Util::rangeField(Util::add2points(array_keys($data)));

        if (!is_null($this->where)) {
            $sql .= ' where ' . $this->where;

            $this->where = null;

            $data = array_merge($data, $this->where_data_binding);

            $this->where_data_binding = [];
        }

        $stmt = $this->connection->prepare($sql);

        $data = Sanitize::make($data, true);

        $this->bind($stmt, $data);

        // Execution of the request
        $stmt->execute();

        $r = $stmt->rowCount();

        return (int) $r;
    }
313918
public function update($data = array()) {
    foreach ($data as $key => $value) {
      $this->{$key} = $value;
    }

    $postData = array();
    foreach (static::$properties as $name) {
      $postData[$name] = $this->data[$name];
    }

    $this->client->put(static::$path . '/' . $this->id(), $postData);

    return $this;
  }
533241
public function updatePoi(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_POI_UPDATE_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] === 'ok';
    }
26798
public function updateGroupProduct(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_GROUP_PRODUCT_UPDATE_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success';
    }
675048
public function updateIf($data)
    {
        $updated = false;
        foreach ($data as $key => $val) {
            if ($val) {
                $this->{$key} = $val;
                $updated = true;
            }
        }

        if ($updated) {
            $this->save();
        }

        return $this;
    }
842042
private function getUpdateQuery(array $data)
    {
        //This is a hack to prevent parameters being mixed up.
        $tempParameters   = $this->parameters;
        $this->parameters = [];

        $query = $this->applyFilters(
            $this->queryBuilder
                ->update($this->entity->getTable())
                ->values($this->parameters($data))
        );

        $this->parameters = array_merge($this->parameters, $tempParameters);

        return $query;
    }
338168
public function updateProduct(array $data)
    {
        $url = "https://api.weixin.qq.com/scan/product/update?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
286933
public function updates($data)
    {
        $data = &$this->loadFilterData($data);
        if ( $data == false ) {
            return false;
        }
        $conditions = $this->sqlBuilder->buildCondition();
        return $this->db->update($this->table, $data, $conditions);
    }
971851
public function updateIndexOne(array $data)
    {
        if (!is_array($data)) {
            throw new \Exception('你的索引参数不是一个数组');
        }

        if (count($data) == count($data, 1)) {
            // 一维数组
            $this->getIndex()->update(new \XSDocument($data));
        }

        //索引是否立即生效
        if ($this->flush_index) {
            $this->getIndex()->flushIndex();
        }

        return $this->getIndex();
    }
560685
public function update(array $data)
    {
        // setup the custom options
        foreach ($this->getCustomOptions() as $key => $value) {
            if (isset($data[$value]) && $data[$value] == 'custom' && $data[$value . '_custom'] != '') {
                $data['_form_' . $value] = $data[$value];
                $data[$value] = $data[$value . '_custom'];
            }
        }
        
        foreach ($data as $key => $value) {
            if (in_array($key, $this->getSerialized())) {
                $value = (is_array($value) ? serialize($value) : serialize(array(
                    $value
                )));
            }
            
            if (in_array($key, $this->getEncrypted()) && $value != '') {
                $value = $this->getEncrypt()->encode($value);
            }
            
            $this->updateSetting($key, $value);
        }
        
        return true;
    }
310345
public function update(array $data)
    {
        $this->attributes = new Collection(array_merge($this->attributes->toArray(), $data));

        return $this->save();
    }
123823
public function updateUserMark(array $data)
    {
        $result = $this->httpRaw(self::WEHCAT_USER_MARK_UPDATE, $data, [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'ok';
    }
587165
public function updateUser(array $data)
    {
        $result = $this->httpRaw(self::WECHAT_USER_UPDATE_PREFIX, $data, [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['errcode']) && !$result['errcode'];
    }
870789
public function update(array $data)
    {
        $upload = Basecamp::uploads($this->bucket->id)
                          ->update($this->id, $data);

        $this->setAttributes($upload);

        return $upload;
    }
1339131
public function update(array $data)
    {
        if (empty($data)) {
            return null;
        }

        if (!array_key_exists('id', $data) || !array_key_exists('email', $data)) {
            return null;
        }

        $data['api_action'] = 'contact_edit';
        $response = $this->request($data, 'POST');

        if ($response === null || $response->getStatusCode() !== 200) {
            return null;
        }

        $json = $response->getBody()->getContents();

        return $this->serializer->deserialize(
            $this->removeResultInformation($json),
            \FondOfPHP\ActiveCampaign\DataTransferObject\Contact::class,
            'json'
        );
    }
495472
public function updateTranslation(array $data)
    {
        $translations = $this->translations()->where([
            'record_id'     => $this->id,
            'language_code' => array_get($data, 'language_code'),
        ])->first();

        if (is_null($translations))
            $translations = $this->translations()->create($data);
        else
            $translations->update($data);

        return $translations;
    }
28164
public function updateWhereData($data) {
        $this->performed = false;
        $this->whereData = array_merge($this->whereData, $data);

        return $this;
    }