public function DataTable::update in Data 7
Same name and namespace in other branches
- 6 includes/DataTable.inc \DataTable::update()
Update table properties.
@todo: make conditional, rename to save().
Parameters
$properties: Array where the key designates a property (one of 'name', 'title', 'table_schema', 'meta') and the value is the unserialized value that this property should attain.
12 calls to DataTable::update()
- DataTable::addField in includes/
DataTable.inc - Add a field.
- DataTable::addIndex in includes/
DataTable.inc - Add an index to table.
- DataTable::addPrimaryKey in includes/
DataTable.inc - Add a primary key to table.
- DataTable::addUniqueKey in includes/
DataTable.inc - Add a unique key to a field.
- DataTable::changeField in includes/
DataTable.inc - Change a field.
File
- includes/
DataTable.inc, line 232 - 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
public function update($properties) {
_data_override($this->name);
$properties['name'] = $this->name;
if (drupal_write_record('data_tables', $properties, 'name')) {
foreach ($properties as $key => $value) {
$this->{$key} = $value;
}
}
}