function hostingService_example_basic::insert in Hosting 7.4
Same name and namespace in other branches
- 6.2 example/hosting_example.service.inc \hostingService_example_basic::insert()
- 7.3 example/example_service/hosting_example.service.inc \hostingService_example_basic::insert()
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
- example/
example_service/ 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);
}