function hosting_services_new_object in Hosting 7.4
Same name and namespace in other branches
- 6.2 server/hosting_server.module \hosting_services_new_object()
- 7.3 server/hosting_server.module \hosting_services_new_object()
Factory method for generating new instance of a service class.
4 calls to hosting_services_new_object()
- hosting_server_form in server/
hosting_server.module - Implements hook_form().
- hosting_server_init_services in server/
hosting_server.module - Initializes the service objects associated with a server node object.
- hosting_server_services_from_post in server/
hosting_server.module - Translate a server form submission into populated server objects on the node.
- hosting_services_add in server/
hosting_server.module - Add a service to an existing server node.
File
- server/
hosting_server.module, line 236
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);
}