You are here

function domain_conf_data_set in Domain Access 7.3

CRUD utility to store configurations for a given domain.

Parameters

int $domain_id: Domain ID to replace configuration for.

array $new_settings: Array of domain configurations to replace the old one.

bool $merge: Flag, whether to merge the config with the existing one on TRUE (Default) or to override it completely on FALSE.

8 calls to domain_conf_data_set()
DomainConfTestCase::testCrudUtilities in domain_conf/tests/domain_conf.test
Base test assertions for the CRUD layer in Domain Conf.
DomainConfTestCase::testDomainConfDataGetCashes in domain_conf/tests/domain_conf.test
domain_conf_delete_variable in domain_conf/domain_conf.module
Delete a setting from {domain_conf}.
domain_conf_features_rebuild in domain_conf/domain_conf.features.inc
Implements hook_features_rebuild().
domain_conf_form_submit in domain_conf/domain_conf.admin.inc
FormsAPI for domain_conf_form().

... See full list

File

domain_conf/domain_conf.module, line 119
Domain manager configuration options.

Code

function domain_conf_data_set($domain_id, array $new_settings, $merge = TRUE) {
  if ($merge) {
    $settings = domain_conf_data_get($domain_id, TRUE);
    $new_settings = array_merge($settings, $new_settings);
  }
  db_merge('domain_conf')
    ->key(array(
    'domain_id' => $domain_id,
  ))
    ->fields(array(
    'domain_id' => $domain_id,
    'settings' => serialize($new_settings),
  ))
    ->execute();

  // Update the static cache for any subsequent gets.
  $static_cache_get =& drupal_static('domain_conf_data_get', array());
  $static_cache_get[$domain_id] = $new_settings;
}