You are here

function data_get_table in Data 7

Same name and namespace in other branches
  1. 8 data.module \data_get_table()
  2. 6 data.module \data_get_table()

Get a table if it exists.

Parameters

$name: Unique name of the table.

Return value

A unique DataTable object if defined, FALSE otherwise.

Note: In some circumstances, a table may be defined while it does not exist in the database. In these cases, data_get_table() would still return a valid DataTable object.

See also

DataTable class.

22 calls to data_get_table()
DataTestCaseAPI::testAPIFunctions in tests/data.test
Test API functions of DataTable and DataHandler.
DataTestCaseUI::testChangeManagement in data_ui/tests/data_ui.test
Test change management on UI.
data_drop_table in ./data.module
@todo: remove.
data_entity_admin_entity_form in data_entity/data_entity.admin.inc
Form builder for table entity options.
data_entity_admin_entity_type_form in data_entity/data_entity.admin.inc
Form builder for the entity type settings.

... See full list

File

./data.module, line 75
Hooks and API functions for data module.

Code

function data_get_table($name) {
  $table = DataTable::instance($name);
  if ($table
    ->defined()) {
    return $table;
  }
  return FALSE;
}