You are here

function registration_entity_settings in Entity Registration 7.2

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

Get registration settings for a host entity.

Parameters

string $entity_type: The host entity type.

int $entity_id: The host entity ID.

Return value

array|bool A row from {registration_entity}, or FALSE if no settings exist.

16 calls to registration_entity_settings()
RegistrationStandardTestCase::testHostEntitySettings in tests/registration.test
Tests entity update helper.
RegistrationStandardTestCase::testHostEntitySettingsForm in tests/registration.test
registration_entity_access_registration_access in modules/registration_entity_access/registration_entity_access.module
Implements hook_registration_access().
registration_entity_settings_page in ./registration.module
Page callback for entity registration settings.
registration_entity_update in ./registration.module
Implements hook_entity_update().

... See full list

File

./registration.module, line 950

Code

function registration_entity_settings($entity_type, $entity_id, $reset = FALSE) {
  $result =& drupal_static(__FUNCTION__ . $entity_type . $entity_id);
  if (!$result || $reset) {
    $result = db_select('registration_entity', 're')
      ->fields('re')
      ->condition('entity_id', $entity_id, '=')
      ->condition('entity_type', $entity_type, '=')
      ->execute()
      ->fetchAssoc();
    if ($result) {
      $result['settings'] = unserialize($result['settings']);
    }
  }
  return $result;
}