You are here

function registration_entity_settings in Entity Registration 8.2

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

18 calls to registration_entity_settings()
RegistrationStandardTestCase::testHostEntitySettings in tests/registration.test
Tests entity update helper.
RegistrationStandardTestCase::testHostEntitySettings in src/RegistrationStandardTestCase.php
Tests entity update helper.
RegistrationStandardTestCase::testHostEntitySettingsForm in tests/registration.test
RegistrationStandardTestCase::testHostEntitySettingsForm in src/RegistrationStandardTestCase.php
registration_entity_access_registration_access in modules/registration_entity_access/registration_entity_access.module
Implements hook_registration_access().

... See full list

File

./registration.module, line 917

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