You are here

protected function DataTable::__construct in Data 6

Same name and namespace in other branches
  1. 7 includes/DataTable.inc \DataTable::__construct()

Constructor. Do not call directly, but use DataTable::instance($name) instead.

File

includes/DataTable.inc, line 58
Contains class definition for DataTable.

Class

DataTable
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.

Code

protected function __construct($name) {
  $this->name = $name;

  // Try to load table information.
  if ($table = _data_load_table($name)) {
    foreach (array(
      'title',
      'name',
      'table_schema',
      'meta',
      'export_type',
    ) as $key) {
      if (isset($table->{$key})) {
        $this->{$key} = $table->{$key};
      }
    }
  }
}