You are here

function registration_update_entity_settings in Entity Registration 7

Same name and namespace in other branches
  1. 8.2 registration.module \registration_update_entity_settings()
  2. 8 registration.module \registration_update_entity_settings()
  3. 7.2 registration.module \registration_update_entity_settings()

Update or create registration settings for a host entity.

Updates settings for a host entity, and displays a message to the user.

Parameters

string $entity_type: The host entity type.

int $entity_id: The host entity ID.

array $settings: Array keyed by field names from {registration_entity}

3 calls to registration_update_entity_settings()
RegistrationTestCase::setHostEntitySettings in tests/registration.test
registration_entity_settings_form_submit in includes/registration.forms.inc
Submit handler for registration_entity_settings_form().
registration_entity_set_default_settings in ./registration.module
Sets the the registration entity settings to the deafults.

File

./registration.module, line 1179

Code

function registration_update_entity_settings($entity_type, $entity_id, $settings) {

  // Insert or update registration entity settings.
  db_merge('registration_entity')
    ->key(array(
    'entity_id' => $entity_id,
    'entity_type' => $entity_type,
  ))
    ->fields($settings)
    ->execute();
  drupal_set_message(t('Registration settings have been saved.'));
}