Schema::escapeDefaultValue

protected Schema::escapeDefaultValue($value)

Return an escaped version of its parameter to be used as a default value on a column.

Parameters

mixed $value: The value to be escaped (int, float, null or string).

Return value

string|int|float The escaped value.

File

core/lib/Drupal/Core/Database/Schema.php, line 654

Class

Schema
Provides a base implementation for Database Schema.

Namespace

Drupal\Core\Database

Code

protected function escapeDefaultValue($value) {
  if (is_null($value)) {
    return 'NULL';
  }
  return is_string($value) ? $this->connection->quote($value) : $value;
}
doc_Drupal
2016-10-29 09:39:54
Comments
Leave a Comment

Please login to continue.