public function Schema::getComment in Zircon Profile 8
Same name in this branch
- 8 core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php \Drupal\Core\Database\Driver\pgsql\Schema::getComment()
- 8 core/lib/Drupal/Core/Database/Driver/mysql/Schema.php \Drupal\Core\Database\Driver\mysql\Schema::getComment()
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php \Drupal\Core\Database\Driver\pgsql\Schema::getComment()
Retrieve a table or column comment.
File
- core/
lib/ Drupal/ Core/ Database/ Driver/ pgsql/ Schema.php, line 826 - Contains \Drupal\Core\Database\Driver\pgsql\Schema.
Class
- Schema
- PostgreSQL implementation of \Drupal\Core\Database\Schema.
Namespace
Drupal\Core\Database\Driver\pgsqlCode
public function getComment($table, $column = NULL) {
$info = $this
->getPrefixInfo($table);
// Don't use {} around pg_class, pg_attribute tables.
if (isset($column)) {
return $this->connection
->query('SELECT col_description(oid, attnum) FROM pg_class, pg_attribute WHERE attrelid = oid AND relname = ? AND attname = ?', array(
$info['table'],
$column,
))
->fetchField();
}
else {
return $this->connection
->query('SELECT obj_description(oid, ?) FROM pg_class WHERE relname = ?', array(
'pg_class',
$info['table'],
))
->fetchField();
}
}