You are here

function hostingService_example_basic::load in Hostmaster (Aegir) 6

Load associated values for the service.

In this example we will use the variable system to retrieve values.

Overrides hostingService::load

File

modules/hosting/example/hosting_example.service.inc, line 71
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 load() {

  // REMEMBER TO CALL THE PARENT!
  parent::load();
  $this->example_field = variable_get('hosting_example_field_' . $this->server->nid, 'default value');

  /**
   * Although this example does not have it's own tables, we provide some utitilty functions
   * for use in this method.
   *
   * If this example used it's own tables, we could use the mergeData method below to merge in the
   * results automatically, instead of iterating through the results ourself.
   */

  // $this->mergeData("SELECT example_field FROM {hosting_example} WHERE vid = %d", $this->server->vid);
}