You are here

function _hosting_package_instance_languages in Hosting 6.2

Same name and namespace in other branches
  1. 5 package/hosting_package.instance.inc \_hosting_package_instance_languages()
  2. 7.4 package/hosting_package.instance.inc \_hosting_package_instance_languages()
  3. 7.3 package/hosting_package.instance.inc \_hosting_package_instance_languages()
2 calls to _hosting_package_instance_languages()
hosting_package_instance_create in package/hosting_package.instance.inc
hosting_package_instance_update in package/hosting_package.instance.inc

File

package/hosting_package.instance.inc, line 82
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);
}