public function Schema::prepareComment in Drupal 10
Same name in this branch
- 10 core/lib/Drupal/Core/Database/Schema.php \Drupal\Core\Database\Schema::prepareComment()
- 10 core/modules/mysql/src/Driver/Database/mysql/Schema.php \Drupal\mysql\Driver\Database\mysql\Schema::prepareComment()
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Database/Schema.php \Drupal\Core\Database\Schema::prepareComment()
- 9 core/lib/Drupal/Core/Database/Schema.php \Drupal\Core\Database\Schema::prepareComment()
Prepare a table or column comment for database query.
Parameters
$comment: The comment string to prepare.
$length: Optional upper limit on the returned string length.
Return value
The prepared comment.
3 calls to Schema::prepareComment()
- Schema::addField in core/
modules/ pgsql/ src/ Driver/ Database/ pgsql/ Schema.php - Add a new field to a table.
- Schema::changeField in core/
modules/ pgsql/ src/ Driver/ Database/ pgsql/ Schema.php - Change a field definition.
- Schema::createTableSql in core/
modules/ pgsql/ src/ Driver/ Database/ pgsql/ Schema.php - Generate SQL to create a new table from a Drupal schema definition.
1 method overrides Schema::prepareComment()
- Schema::prepareComment in core/
modules/ mysql/ src/ Driver/ Database/ mysql/ Schema.php - Prepare a table or column comment for database query.
File
- core/
lib/ Drupal/ Core/ Database/ Schema.php, line 655
Class
- Schema
- Provides a base implementation for Database Schema.
Namespace
Drupal\Core\DatabaseCode
public function prepareComment($comment, $length = NULL) {
// Remove semicolons to avoid triggering multi-statement check.
$comment = strtr($comment, [
';' => '.',
]);
return $this->connection
->quote($comment);
}