function registration_entity_set_default_settings in Entity Registration 7
Same name and namespace in other branches
- 8.2 registration.module \registration_entity_set_default_settings()
- 8 registration.module \registration_entity_set_default_settings()
- 7.2 registration.module \registration_entity_set_default_settings()
Sets the the registration entity settings to the deafults.
Parameters
$entity_type:
$entity:
2 calls to registration_entity_set_default_settings()
- registration_entity_insert in ./
registration.module - Implements hook_entity_insert().
- registration_entity_update in ./
registration.module - Implements hook_entity_update().
File
- ./
registration.module, line 912
Code
function registration_entity_set_default_settings($entity_type, $entity) {
list($entity_id, , $bundle) = entity_extract_ids($entity_type, $entity);
$registration_instances = registration_get_registration_instances(array(
'entity_type' => $entity_type,
'bundle' => $bundle,
));
foreach ($registration_instances as $instance) {
if (isset($instance['settings']['default_registration_settings'])) {
$settings = registration_convert_form_settings($instance['settings']['default_registration_settings']);
registration_update_entity_settings($entity_type, $entity_id, $settings);
}
}
}