You are here

protected function Model::update in Little helpers 7.2

Same name and namespace in other branches
  1. 7 src/DB/Model.php \Drupal\little_helpers\DB\Model::update()
1 call to Model::update()
Model::save in src/DB/Model.php

File

src/DB/Model.php, line 45

Class

Model

Namespace

Drupal\little_helpers\DB

Code

protected function update() {
  $stmt = db_update(static::$table);
  foreach (static::$key as $key) {
    $stmt
      ->condition($key, $this->{$key});
  }
  $stmt
    ->fields($this
    ->values(static::$values))
    ->execute();
}