protected function IntColumnHandlerMySQL::createBody in Dynamic Entity Reference 8.2
Creates the body of the trigger.
Creates a part of the statement to set the value of the integer column to the integer value of the string column.
Parameters
string $column_int: The name of the target_id_int column.
string $column: The name of the target_id column.
Overrides IntColumnHandler::createBody
File
- src/
Storage/ IntColumnHandlerMySQL.php, line 13
Class
- IntColumnHandlerMySQL
- MySQL implementation of denormalizing into integer columns.
Namespace
Drupal\dynamic_entity_reference\StorageCode
protected function createBody($column_int, $column) {
return "NEW.{$column_int} = IF(NEW.{$column} REGEXP '^[0-9]+\$', CAST(NEW.{$column} AS UNSIGNED), NULL)";
}