function hostingService_example_basic::insert in Hostmaster (Aegir) 6
Insert a record into the database.
Called by hosting_server_hook_insert().
The values associated with this implementation have already been set as properties of $this object, so we now need to save them.
For this example we will use the variables table, but you should create your own tables with an install file and hook_schema.
Overrides hostingService::insert
File
- modules/
hosting/ example/ hosting_example.service.inc, line 158 - Example service implementation for the hosting front end.
Class
- hostingService_example_basic
- An implementation of the example service type, registered with hook_hosting_service.
Code
function insert() {
// REMEMBER TO CALL THE PARENT!
parent::insert();
variable_set('hosting_example_field_' . $this->server->nid, $this->example_field);
}