function hosting_services_new_object in Hostmaster (Aegir) 6
Factory method for generating new instance of a service class.
4 calls to hosting_services_new_object()
- hosting_server_form in modules/
hosting/ server/ hosting_server.module - Implementation of hook_form().
- hosting_server_init_services in modules/
hosting/ server/ hosting_server.module - Initializes the service objects associated with a server node object.
- hosting_server_services_from_post in modules/
hosting/ server/ hosting_server.module - Translate a server form submission into populated server objects on the node.
- hosting_services_add in modules/
hosting/ server/ hosting_server.module - Add a service to an existing server node.
File
- modules/
hosting/ server/ hosting_server.module, line 121
Code
function hosting_services_new_object($name, $type, $node, $values = null) {
$services = hosting_server_services();
$class = $services[$name]['types'][$type];
if (!$class) {
return;
}
return new $class($node, $values);
}