1.20.x schema.inc protected DatabaseSchema_mysql::getPrefixInfo($table = 'default', $add_prefix = TRUE)

Get information about the table and database name from the prefix.

Return value

A keyed array with information about the database, table name and prefix.:

Overrides DatabaseSchema::getPrefixInfo

File

drivers/database_mysql/schema.inc, line 32
Database schema code for MySQL database servers.

Class

DatabaseSchema_mysql

Code

protected function getPrefixInfo($table = 'default', $add_prefix = TRUE) {
  $info = array('prefix' => $this->connection->tablePrefix($table));
  if ($add_prefix) {
    $table = $info['prefix'] . $table;
  }
  if (($pos = strpos($table, '.')) !== FALSE) {
    $info['database'] = substr($table, 0, $pos);
    $info['table'] = substr($table, ++$pos);
  }
  else {
    $db_info = $this->connection->getConnectionOptions();
    $info['database'] = $db_info['database'];
    $info['table'] = $table;
  }
  return $info;
}