You are here

function registration_entity_set_default_settings in Entity Registration 8

Same name and namespace in other branches
  1. 8.2 registration.module \registration_entity_set_default_settings()
  2. 7.2 registration.module \registration_entity_set_default_settings()
  3. 7 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 842

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);
    }
  }
}