protected function DataTable::__construct in Data 7
Same name and namespace in other branches
- 6 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) {
// Set our name after sanitizing it.
$this->name = db_escape_table($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};
}
}
}
}