You are here

protected function IntColumnHandlerMySQL::createTrigger in Dynamic Entity Reference 8.2

Actually creates the trigger.

Parameters

string $trigger: The name of the trigger.

string $op: Either UPDATE or INSERT.

string $prefixed_name: The already prefixed table table.

string $body: The body of the trigger.

Overrides IntColumnHandler::createTrigger

File

src/Storage/IntColumnHandlerMySQL.php, line 20

Class

IntColumnHandlerMySQL
MySQL implementation of denormalizing into integer columns.

Namespace

Drupal\dynamic_entity_reference\Storage

Code

protected function createTrigger($trigger, $op, $prefixed_name, $body) {
  $this->connection
    ->query("CREATE TRIGGER {$trigger} BEFORE {$op} ON {$prefixed_name} FOR EACH ROW SET {$body}", [], [
    'allow_square_brackets' => TRUE,
  ]);
}