saveRevision example

// Remove the ID from the record to enable updates on SQL variants           // that prevent updating serial columns, for example, mssql.           unset($record->{$this->idKey});
          $this->database
            ->update($this->baseTable)
            ->fields((array) $record)
            ->condition($this->idKey, $id)
            ->execute();
        }
        if ($this->revisionTable) {
          if ($full_save) {
            $entity->{$this->revisionKey} = $this->saveRevision($entity);
          }
          else {
            $record = $this->mapToStorageRecord($entity->getUntranslated()$this->revisionTable);
            // Remove the revision ID from the record to enable updates on SQL             // variants that prevent updating serial columns, for example,             // mssql.             unset($record->{$this->revisionKey});
            $entity->preSaveRevision($this$record);
            $this->database
              ->update($this->revisionTable)
              ->fields((array) $record)
              
Home | Imprint | This part of the site doesn't use cookies.