You are here

function _hosting_package_instance_languages in Hosting 7.4

Same name and namespace in other branches
  1. 5 package/hosting_package.instance.inc \_hosting_package_instance_languages()
  2. 6.2 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
@todo Please document this function.
hosting_package_instance_update in package/hosting_package.instance.inc
@todo Please document this function.

File

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

Code

function _hosting_package_instance_languages($instance) {
  if (isset($instance->languages) && count($instance->languages)) {
    db_delete('hosting_package_languages')
      ->condition('iid', $instance->iid)
      ->execute();
    foreach ($instance->languages as $language) {
      $id = db_insert('hosting_package_languages')
        ->fields(array(
        'iid' => $instance->iid,
        'language' => $language,
      ))
        ->execute();
    }
  }

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