You are here

public function Table::disown in Data 8

Remove a table from Data module's management, ie unadopt it.

Uses the $name property of the object to determine which database table to adopt.

Return value

TRUE if the table was successfully disowned; FALSE if the query failed, or if Schema isn't available.

File

src/Table.php, line 181

Class

Table
Manages data access and manipulation for a single data table. Use data_create_table() or data_get_table() to instantiate an object from this class.

Namespace

Drupal\data

Code

public function disown() {
  if (!module_exists('schema')) {
    return FALSE;
  }
  $num_deleted = \Drupal::database()
    ->delete('data_tables')
    ->condition('name', $this->name)
    ->execute();
  return $num_deleted == 1;
}