You are here

public function Schema::prepareComment in Drupal driver for SQL Server and SQL Azure 8

Same name and namespace in other branches
  1. 8.2 drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\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.

Overrides Schema::prepareComment

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php, line 1775
Definition of Drupal\Driver\Database\sqlsrv\Schema

Class

Schema

Namespace

Drupal\Driver\Database\sqlsrv

Code

public function prepareComment($comment, $length = NULL) {

  // Truncate comment to maximum comment length.
  if (isset($length)) {

    // Add table prefixes before truncating.
    $comment = Unicode::truncateBytes($this->connection
      ->prefixTables($comment), $length, TRUE, TRUE);
  }
  return $this->connection
    ->quote($comment);
}