Update an Ontraport resource.

@param  mixed  $data
@param  array|null $override
@return \Wsio\Ontraport\Fluent
186848
public function update($data, $override = null)
    {
        if (func_num_args() == 2) {
            $override['id'] = $data;
            $data = $override;
        }

        $response = $this->ontraport->put(
            $this->getNamespace(), $this->toArray($data)
        );

        return $this->ontraport->item($this, $response);
    }
319523
public function create(bool $override): bool {
        if ($this->isFile() && !$override) return false;
        $handle = @fopen($this->path, 'w');
        if (false === $handle) return false;
        fclose($handle);
        return true;
    }
1131251
public function params($name, $params = null, $override = false)
    {
        $overrideAll = (is_array($name) && is_bool($params)) ? $params : false;
        Util::operateArray($this->smsData['params'], $name, $params, [], function ($name, array $params) use ($override) {
            if (!isset($this->smsData['params'][$name])) {
                $this->smsData['params'][$name] = [];
            }
            $target = &$this->smsData['params'][$name];
            if ($override) {
                $target = $params;
            } else {
                $target = array_merge($target, $params);
            }
        }, $overrideAll);

        return $this;
    }
21873
protected function update_last_message( $overrides = [] ) {
		if ( $this->messages->isNotEmpty() ) {
			$this->messages->last()->update( $overrides );
		}

		return $this;
	}
414988
public static function SetFactory($Factory, $Override = TRUE) {
      if ($Override || is_null(self::$_Factory))
         self::$_Factory = $Factory;
   }
1269559
public function sendCookies($override = false)
    {
        if (headers_sent() && !$override) {
            return $this;
        }

        // Iterate through our Cookies data collection and set each cookie natively
        foreach ($this->cookies as $cookie) {
            // Use the built-in PHP "setcookie" function
            setcookie(
                $cookie->getName(),
                $cookie->getValue(),
                $cookie->getExpire(),
                $cookie->getPath(),
                $cookie->getDomain(),
                $cookie->getSecure(),
                $cookie->getHttpOnly()
            );
        }

        return $this;
    }
517623
public function setOverrides($overrides)
    {
        $fieldsOverridden = [];
        if (isset($this->payload->body)) {
            foreach ($this->payload->body as &$field) {
                if (
                    isset($field->overridable)
                    && true === $field->overridable
                    && isset($field->key)
                    && isset($overrides[$field->key])
                    && null !== $overrides[$field->key]
                ) {
                    $field->value                  = $overrides[$field->key];
                    $fieldsOverridden[$field->key] = $overrides[$field->key];
                }
            }
        }
        if ($fieldsOverridden) {
            $this->setLogs($fieldsOverridden, 'fieldsOverridden');
        }

        return $this;
    }
154859
public function sendData($data)
    {
        $data = parent::sendData($data);

        return $this->response = new AopTradeCloseResponse($this, $data);
    }
1252603
public function add(string $key, $value, bool $override = false)
    {
        if (!$override && $this->exists($key)) {
            return;
        }

        $this->parameters[$key] = $value;
    }
505590
public function update($data)
    {
        if (isset($data['stackName'])) {
            $txt = Core::make('helper/text');
            $data['cName'] = $data['stackName'];
            $data['cHandle'] = str_replace('-', Config::get('concrete.seo.page_path_separator'), $txt->urlify($data['stackName']));
        }
        $worked = parent::update($data);

        if (isset($data['stackName'])) {
            // Make sure the stack path is always up-to-date after a name change
            $this->rescanCollectionPath();

            $db = Database::connection();
            $stackName = $data['stackName'];
            $db->Execute('update Stacks set stName = ? WHERE cID = ?', [$stackName, $this->getCollectionID()]);
        }

        return $worked;
    }
504913
public function add($data, $overwrite = true)
    {
        foreach ($data as $property => $value) {
            if ($overwrite || !$this->offsetExists($property)) {
                $this->set($property, $value);
            }
        }
        return $this;
    }
699822
public function setAllowOverride($allowOverride)
    {
        if ($this->locked) {
            throw new Exception\LockedContainerException();
        }

        $this->allowOverride = (bool) $allowOverride;

        return $this;
    }
592758
public function append($append = [], $override = false)
    {
        $this->each(function ($model) use ($append, $override) {
            /** @var Model $model */
            $model && $model->append($append, $override);
        });

        return $this;
    }
344542
public function setData($data)
    {
        foreach ($data as $key => $dtoData) {
            $this->data[$key] = new RuneDto($dtoData);
        }
    
        return $this;
    }
836917
public function overwrite($data)
    {
        $body = $this->getBody();
        $body->rewind();
        $body->write($data);

        return $this;
    }
783118
public function merge($newValues, $override = true)
    {
        foreach ($newValues as $key => $value) {
            // If the key doesn't exist yet,
            // we can simply set it.
            if (!array_key_exists($key, $this)) {
                $this[$key] = $value;
                continue;
            }

            // We already know this value exists
            // so if we're in conservative mode
            // we can skip this key
            if ($override === false) {
                continue;
            }

            // Merge the values only if
            // both values are arrays
            if (is_array($this[$key]) && is_array($value)) {
                $this[$key] = array_replace_recursive($this[$key], $value);
            } else {
                $this[$key] = $value;
            }
        }
    }
1258741
public function setOverrides($overrides)
    {
        $fieldsOverridden = [];
        if (isset($this->payload->operations)) {
            foreach ($this->payload->operations as $id => &$operation) {
                // API Payloads can optionally have their URLs overriden per request.
                $key = 'payload.operation.'.$id.'.request.url';
                if (
                    isset($operation->request->overridableUrl)
                    && true === $operation->request->overridableUrl
                    && !empty($overrides[$key])
                ) {
                    $fieldsOverridden[$key]  = [
                        'key'   => $key,
                        'value' => $overrides[$key],
                    ];
                    $operation->request->url = $overrides[$key];
                }
                if (isset($operation->request)) {
                    foreach (['headers', 'body'] as $type) {
                        if (isset($operation->request->{$type})) {
                            foreach ($operation->request->{$type} as &$field) {
                                if (
                                    isset($field->overridable)
                                    && true === $field->overridable
                                    && isset($field->key)
                                    && isset($overrides[$field->key])
                                    && null !== $overrides[$field->key]
                                ) {
                                    $field->value                  = $overrides[$field->key];
                                    $fieldsOverridden[$field->key] = $overrides[$field->key];
                                }
                            }
                        }
                    }
                }
            }
        }
        if ($fieldsOverridden) {
            $this->setLogs($fieldsOverridden, 'fieldsOverridden');
        }

        return $this;
    }