You are here

public function LogStorage::updateType in Log entity 8

Updates all logs of one type to be of another type.

Parameters

string $old_type: The current log type of the logs.

string $new_type: The new log type of the logs.

Return value

int The number of logs whose log type field was modified.

Overrides LogStorageInterface::updateType

File

src/LogStorage.php, line 52
Contains \Drupal\log\LogStorage.

Class

LogStorage
Defines the controller class for logs.

Namespace

Drupal\log

Code

public function updateType($old_type, $new_type) {
  return $this->database
    ->update('log')
    ->fields(array(
    'type' => $new_type,
  ))
    ->condition('type', $old_type)
    ->execute();
}