You are here

function _data_override in Data 8

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

Starts overriding a data table by copying it from the default definition into the DB. This function does not have any effect if called on a table that does already exist in data_tables.

File

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

Code

function _data_override($name) {
  if (!\Drupal::database()
    ->query("SELECT name FROM {data_tables} WHERE name = :name", array(
    ':name' => $name,
  ))
    ->fetchField()) {
    if ($table = _data_load_table($name)) {
      drupal_write_record('data_tables', $table);
    }
  }
}