code: protected function updateRule($name, $rule)
      {
          if ($rule->name !== $name && !$this->supportsCascadeUpdate()) {
              $this->db->createCommand()
                  ->update($this->itemTable, ['rule_name' => $rule->name], ['rule_name' => $name])
                  ->execute();
          }
  
          $rule->updatedAt = time();
  
          $this->db->createCommand()
              ->update($this->ruleTable, [
                  'name' => $rule->name,
                  'data' => serialize($rule),
                  'updated_at' => $rule->updatedAt,
              ], [
                  'name' => $name,
              ])->execute();
  
          $this->invalidateCache();
  
          return true;
      }
docs: {@inheritdoc}