You are here

function _hosting_package_instance_languages in Hostmaster (Aegir) 6

2 calls to _hosting_package_instance_languages()
hosting_package_instance_create in modules/hosting/package/hosting_package.instance.inc
hosting_package_instance_update in modules/hosting/package/hosting_package.instance.inc

File

modules/hosting/package/hosting_package.instance.inc, line 58
API for mapping packages to various Hosting node types

Code

function _hosting_package_instance_languages($instance) {
  if (sizeof($instance->languages)) {
    db_query("DELETE FROM {hosting_package_languages} WHERE iid=%d", $instance->iid);
    foreach ($instance->languages as $language) {
      db_query("INSERT INTO {hosting_package_languages} (iid, language) VALUES (%d, '%s')", $instance->iid, $language);
    }
  }

  // Clear the static cache for languages of package instances.
  _hosting_package_instances_load_languages(NULL, TRUE);
}