Update Rule in Database

@param mixed $rule

@access public
@return void
510891
public function updateRule($rule) {
        $logger = $GLOBALS['logger'];
        $path    = 'rules/update';
        $request = $this->_remoteServer->put(
            $path,
            array('Content-Type'=>'application/json'),
            $rule
        );
        try {
            $response = $request->send();
            if ($response->getStatusCode() !== 200) {
                throw new \Exception('Unable to handle request');
            }
            $rawResponse = $response->getBody('true');
            return $rawResponse;
        } catch (\Exception $e) {
            throw $e; 
        }
        
    }
1296184
public  function addRules($rules) {
        if ( is_array($rules) && !empty($rules) )
		    self::$tempRules = array_merge(self::$tempRules, $rules);
	}
873686
protected function applyRule($word, $rule)
    {
        return substr_replace($word, $rule[self::APPEND_STRING], strlen($word) - $rule[self::REMOVE_TOTAL]);        
    }
846822
protected function extendValidator($rule)
    {
        $method = studly_case($rule);
        $translation = $this->app['translator']->trans('image-validator::validation.' . $rule);
        $this->app['validator']->extend($rule, 'Cviebrock\ImageValidator\ImageValidator@validate' . $method,
            $translation);
        $this->app['validator']->replacer($rule, 'Cviebrock\ImageValidator\ImageValidator@replace' . $method);
    }
692859
public function mapFieldsRules(array $rules)
    {
        foreach ($rules as $field => $rule) {
            $this->mapFieldRules($field, $rule);
        }
    }
255200
public function setRules(array $rules)
    {
        $this->rules = [];

        foreach ($rules as $rule) {
            $controller  = strtolower($rule['controller']);
            $actions     = isset($rule['actions']) ? (array)$rule['actions'] : [];
            $permissions = (array)$rule['permissions'];

            if (empty($actions)) {
                $this->rules[$controller][0] = $permissions;
                continue;
            }

            foreach ($actions as $action) {
                $this->rules[$controller][strtolower($action)] = $permissions;
            }
        }
    }
679424
protected function checkRuleCorrect($rule)
    {
        if (!isset($rule->value)) {
            // We will assume a missing value for the rule is to be interpreted as empty.
            $rule->value = null;
        }
        if (!isset($rule->id, $rule->field, $rule->type, $rule->input, $rule->operator)) {
            return false;
        }
        if (!isset($this->operators[$rule->operator])) {
            return false;
        }

        return true;
    }
423054
protected function updatePriceRule()
    {
        $this->controlAccess('price_rule_edit');

        if ($this->price_rule->update($this->data_rule['price_rule_id'], $this->getSubmitted())) {
            $this->redirect('admin/sale/price', $this->text('Price rule has been updated'), 'success');
        }

        $this->redirect('', $this->text('Price rule has not been updated'), 'warning');
    }
484731
public function update($document): void
    {
        $class = $this->dm->getClassMetadata(get_class($document));
        $data = $this->prepareUpdateData($document);
        $id = $class->getSingleIdentifier($document);

        $this->collection->update((string) $id, $data['body'], $data['script']);
    }
1284206
public function setRules( $rules )
    {
        $this->rules = array();

        foreach ( $rules as $rule )
        {
            $this->addRule( $rule );
        }

        return $this;
    }
967512
def update(self, **kwargs):
        """"""
        self._check_exclusive_parameters(**kwargs)
        return super(Rule, self)._update(**kwargs)
1237694
public function update($entity)
    {
        $this->gateway->update($this->tableName, $this->builder->reduce($entity), $this->getIdentifier($entity));
        $this->builder->resolve($entity);
    }
1024802
public function addRules($rules)
    {
        // The primary purpose of this parser is to expand any "*" rules to the all
        // of the explicit rules needed for the given data. For example the rule
        // names.* would get expanded to names.0, names.1, etc. for this data.
        $response = (new ValidationRuleParser($this->data))
                            ->explode($rules);

        $this->rules = array_merge_recursive(
            $this->rules, $response->rules
        );

        $this->implicitAttributes = array_merge(
            $this->implicitAttributes, $response->implicitAttributes
        );
    }
846399
protected function addRule(IRule $rule)
    {
        if ($this->inCondition) {
            /** @var ConditionalRule $lastRule */
            $lastRule = $this->rules[count($this->rules) - 1];
            $lastRule->addRule($rule);
        } else {
            $this->rules[] = $rule;
        }
    }
1180007
private function update($model)
    {
        $attrs = $this->getMutableAttributes($model);
        $values = array_values($attrs);
        $values[] = $model->{$this->key};
        $this->db
            ->connect()
            ->update($this->table, array_keys($attrs))
            ->where($this->key . ' = ?')
            ->execute($values);
    }
751445
public function update () : bool
	{
        $dbObject 	= Database::getInstance();
		$sqlQuery 	= "UPDATE ".static::$tableName." SET ".$this->generateQueryForUPdate();
		$sqlQuery  .= " WHERE id = ". $dbObject->escapeValue($this->id);
		$result 	= $dbObject->query($sqlQuery);
    	return ($result) ? TRUE : FALSE;
	}
716818
public function postUpdate($object): void
    {
        /** @var BlockAdmin $block */
        $blockManager = $this->blockManager;

        $block = $blockManager->get($object);
        $block->postUpdate($object);

        $service = $blockManager->get($object);

        $this->cacheManager->invalidate($service->getCacheKeys($object));
    }