buildTableNameCondition

  1. drupal
    1. drupal7
Versionen
drupal7 protected DatabaseSchema_mysql::buildTableNameCondition($table_name, $operator = '=')

Build a condition to match a table name against a standard information_schema.

MySQL uses databases like schemas rather than catalogs so when we build a condition to query the information_schema.tables, we set the default database as the schema unless specified otherwise, and exclude table_catalog from the condition criteria.

Verwandte Themen

Code

includes/database/mysql/schema.inc, line 35

<?php
protected function buildTableNameCondition($table_name, $operator = '=') {
  $info = Database::getConnectionInfo();

  if (strpos($table_name, '.')) {
    list($schema, $table_name) = explode('.', $table_name);
  }
  else {
    $schema = $info['default']['database'];
  }

  $condition = new DatabaseCondition('AND');
  $condition->condition('table_schema', $schema);
  $condition->condition('table_name', $table_name, $operator);
  return $condition;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen