You are here

class Drupal7Backend in Configuration Management 7.3

Hierarchy

Expanded class hierarchy of Drupal7Backend

File

src/Backends/Drupal7Backend.php, line 5

Namespace

Configuration\Backends
View source
class Drupal7Backend implements BackendInterface {
  public function cache_clear_all($cid = NULL, $bin = NULL, $wildcard = FALSE) {
    return cache_clear_all($cid, $bin, $wildcard);
  }
  public function drupal_static_reset($function) {
    return drupal_static_reset($function);
  }
  public function entity_crud_get_info() {
    return entity_crud_get_info();
  }
  public function entity_get_info($entity_type) {
    return entity_get_info($entity_type);
  }
  public function entity_label($type, $entity) {
    entity_label($type, $entity);
  }
  public function entity_load_multiple_by_name($name, $reset) {
    return entity_load_multiple_by_name($name, $reset);
  }
  public function entity_load_single($type, $name) {
    return entity_load_single($type, $name);
  }
  public function field_create_field($field) {
    return field_create_field($field);
  }
  public function field_create_instance($field) {
    return field_create_instance($field);
  }
  public function field_delete_field($name) {
    return field_delete_field($name);
  }
  public function field_delete_instance($instance, $field_cleanup) {
    return field_delete_instance($instance, $field_cleanup);
  }
  public function field_info_cache_clear() {
    return field_info_cache_clear();
  }
  public function field_info_field($name) {
    return field_info_field($name);
  }
  public function field_info_fields() {
    return field_info_fields();
  }
  public function field_info_instance($entity_type, $field_name, $bundle) {
    return field_info_instance($entity_type, $field_name, $bundle);
  }
  public function field_info_instances() {
    return field_info_instances();
  }
  public function field_purge_batch($count) {
    return field_purge_batch($count);
  }
  public function field_update_field($field) {
    return field_update_field($field);
  }
  public function field_update_instance($field) {
    return field_update_instance($field);
  }
  public function filter_format_disable($format) {
    return filter_format_disable($format);
  }
  public function filter_format_load($name) {
    return filter_format_load($name);
  }
  public function filter_format_save($format) {
    return filter_format_save($format);
  }
  public function filter_formats() {
    return filter_formats();
  }
  public function filter_get_filters() {
    return filter_get_filters();
  }
  public function filter_list_format($name) {
    return filter_list_format($name);
  }
  public function filter_permission_name($format) {
    return filter_permission_name($format);
  }
  public function image_default_style_revert($name) {
    return image_default_style_revert($name);
  }
  public function image_effect_delete($effect) {
    return image_effect_delete($effect);
  }
  public function image_effect_save($effect) {
    return image_effect_save($effect);
  }
  public function image_style_delete($style) {
    return image_style_delete($style);
  }
  public function image_style_flush($style) {
    return image_style_flush($style);
  }
  public function image_style_load($name) {
    return image_style_load($name);
  }
  public function image_styles() {
    return image_styles();
  }
  public function language_list() {
    return language_list();
  }
  public function language_removeFromDatabase($langcode) {
    $languages = language_list();
    if (isset($languages[$langcode])) {

      // Remove translations first.
      db_delete('locales_target')
        ->condition('language', $langcode)
        ->execute();
      cache_clear_all('locale:' . $langcode, 'cache');

      // With no translations, this removes existing JavaScript translations file.
      _locale_rebuild_js($langcode);

      // Remove the language.
      db_delete('languages')
        ->condition('language', $langcode)
        ->execute();
      db_update('node')
        ->fields(array(
        'language' => '',
      ))
        ->condition('language', $langcode)
        ->execute();
      if ($languages[$langcode]->enabled) {
        variable_set('language_count', variable_get('language_count', 1) - 1);
      }
      module_invoke_all('multilingual_settings_changed');
    }

    // Changing the language settings impacts the interface:
    cache_clear_all('*', 'cache_page', TRUE);
  }
  public function language_writeToDatabase($language) {
    $current_language = db_select('languages')
      ->condition('language', $language->language)
      ->fields('languages')
      ->execute()
      ->fetchAssoc();

    // Set the default language when needed.
    $default = language_default();

    // Insert new language via api function.
    if (empty($current_language)) {
      locale_add_language($language->language, $language->name, $language->native, $language->direction, $language->domain, $language->prefix, $language->enabled, $language->language == $default->language);

      // Additional params, locale_add_language does not implement.
      db_update('languages')
        ->fields(array(
        'plurals' => empty($language->plurals) ? 0 : $language->plurals,
        'formula' => empty($language->formula) ? '' : $language->formula,
      ))
        ->condition('language', $language->language)
        ->execute();
    }
    else {
      $schema = drupal_get_schema('languages');
      $properties = array_keys($schema['fields']);

      // The javascript hash is not in the imported data but should be empty
      if (!isset($language->javascript)) {
        $language->javascript = '';
      }
      $fields = array_intersect_key((array) $language, array_flip($properties));
      db_update('languages')
        ->fields($fields)
        ->condition('language', $language->language)
        ->execute();

      // Set the default language when needed.
      $default = language_default();
      if ($default->language == $language->language) {
        variable_set('language_default', (object) $fields);
      }
    }
  }
  public function locale_add_language($langcode, $name = NULL, $native = NULL, $direction = LANGUAGE_LTR, $domain = '', $prefix = '', $enabled = TRUE, $default = FALSE) {
    return locale_add_language($langcode, $name, $native, $direction, $domain, $prefix, $enabled, $default);
  }
  public function locale_language_list($field = 'name', $all = FALSE) {
    return locale_language_list($field, $all);
  }
  public function locale_rebuild_js($langcode) {
    return locale_rebuild_js($langcode);
  }
  public function menu_delete($menu) {
    return menu_delete($menu);
  }
  public function menu_getIdentifiers() {
    $menus = db_query("SELECT menu_name, title FROM {menu_custom}")
      ->fetchAll();
    $identifiers = array();
    foreach ($menus as $menu) {
      $identifiers[str_replace('-', '_', $menu->menu_name)] = $menu->title;
    }
    return $identifiers;
  }
  public function menu_load($name) {
    return menu_load($name);
  }
  public function menu_save($menu) {
    return menu_save($menu);
  }
  public function module_exists($module) {
    return module_exists($module);
  }
  public function module_invoke_all($hook) {
    return module_invoke_all($hook);
  }
  public function node_type_delete($name) {
    return node_type_delete($name);
  }
  public function node_type_get_names() {
    return node_type_get_names();
  }
  public function node_type_get_type($name) {
    return node_type_get_type($name);
  }
  public function node_type_save($node_type) {
    return node_type_save($node_type);
  }
  public function permission_deletePermission($permission) {
    return db_delete('role_permission')
      ->condition('permission', $permission)
      ->execute();
  }
  public function permission_savePermission($permission) {
    $fields = array();
    foreach ($permission['roles'] as $role) {
      $fields[] = array(
        'rid' => $this->roles_ids[$role],
        'permission' => $permission['permission'],
        'module' => $permission['module'],
      );
    }
    if (!empty($fields)) {

      // Grant access only to the roles defined
      return db_insert('role_permission')
        ->fields($fields)
        ->execute();
    }
  }
  public function role_export_roles() {
    return role_export_roles();
  }
  public function role_roleExists($name) {
    return db_query("SELECT rid\n                     FROM {role}\n                     WHERE machine_name = :name", array(
      ':name' => $name,
    ))
      ->fetchField();
  }
  public function user_permission_get_modules() {
    return user_permission_get_modules();
  }
  public function user_role_delete($role) {
    return user_role_delete($role);
  }
  public function user_role_permissions($roles) {
    return user_role_permissions($roles);
  }
  public function user_role_save($role) {
    return user_role_save($role);
  }
  public function variable_del($name) {
    return variable_del($name);
  }
  public function variable_get($name, $default = NULL) {
    return variable_get($name, $default);
  }
  public function variable_getIdentifiers() {
    return db_query("SELECT name, name\n                     FROM {variable}\n                     ORDER BY name ASC")
      ->fetchAllKeyed();
  }
  public function variable_set($name, $value) {
    return variable_set($name, $value);
  }
  public function view_getIdentifiers() {
    return db_query("SELECT name, human_name\n                     FROM {views_view}\n                     ORDER BY name ASC")
      ->fetchAllKeyed();
  }
  public function views_delete_view($view) {
    return views_delete_view($view);
  }
  public function views_get_view($name) {
    return views_get_view($name);
  }
  public function views_new_view() {
    return views_new_view();
  }
  public function views_save_view($view) {
    return views_save_view($view);
  }
  public function taxonomy_get_vocabularies() {
    return taxonomy_get_vocabularies();
  }
  public function taxonomy_vocabulary_machine_name_load($name) {
    return taxonomy_vocabulary_machine_name_load($name);
  }
  public function taxonomy_vocabulary_save($vocabulary) {
    return taxonomy_vocabulary_save($vocabulary);
  }
  public function taxonomy_vocabulary_delete($vid) {
    return taxonomy_vocabulary_delete($vid);
  }
  public function text_format_getFilterFormat($name) {
    return db_select('filter_format')
      ->fields('filter_format')
      ->condition('format', $name)
      ->execute()
      ->fetchObject();
  }
  public function wysiwyg_get_profile($name) {
    return wysiwyg_get_profile($name);
  }
  public function wysiwyg_profile_cache_clear() {
    return wysiwyg_profile_cache_clear();
  }
  public function wysiwyg_profile_delete($name) {
    return wysiwyg_profile_delete($name);
  }
  public function wysiwyg_profile_load_all() {
    return wysiwyg_profile_load_all();
  }
  public function wysiwyg_saveProfile($profile) {
    return db_merge('wysiwyg')
      ->key(array(
      'format' => $profile->format,
    ))
      ->fields(array(
      'format' => $profile->format,
      'editor' => $profile->editor,
      'settings' => serialize($profile->settings),
    ))
      ->execute();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Drupal7Backend::cache_clear_all public function Overrides BackendInterface::cache_clear_all
Drupal7Backend::drupal_static_reset public function Overrides BackendInterface::drupal_static_reset
Drupal7Backend::entity_crud_get_info public function Overrides BackendInterface::entity_crud_get_info
Drupal7Backend::entity_get_info public function Overrides BackendInterface::entity_get_info
Drupal7Backend::entity_label public function Overrides BackendInterface::entity_label
Drupal7Backend::entity_load_multiple_by_name public function Overrides BackendInterface::entity_load_multiple_by_name
Drupal7Backend::entity_load_single public function Overrides BackendInterface::entity_load_single
Drupal7Backend::field_create_field public function Overrides BackendInterface::field_create_field
Drupal7Backend::field_create_instance public function Overrides BackendInterface::field_create_instance
Drupal7Backend::field_delete_field public function Overrides BackendInterface::field_delete_field
Drupal7Backend::field_delete_instance public function Overrides BackendInterface::field_delete_instance
Drupal7Backend::field_info_cache_clear public function Overrides BackendInterface::field_info_cache_clear
Drupal7Backend::field_info_field public function Overrides BackendInterface::field_info_field
Drupal7Backend::field_info_fields public function Overrides BackendInterface::field_info_fields
Drupal7Backend::field_info_instance public function Overrides BackendInterface::field_info_instance
Drupal7Backend::field_info_instances public function Overrides BackendInterface::field_info_instances
Drupal7Backend::field_purge_batch public function Overrides BackendInterface::field_purge_batch
Drupal7Backend::field_update_field public function Overrides BackendInterface::field_update_field
Drupal7Backend::field_update_instance public function Overrides BackendInterface::field_update_instance
Drupal7Backend::filter_formats public function Overrides BackendInterface::filter_formats
Drupal7Backend::filter_format_disable public function Overrides BackendInterface::filter_format_disable
Drupal7Backend::filter_format_load public function Overrides BackendInterface::filter_format_load
Drupal7Backend::filter_format_save public function Overrides BackendInterface::filter_format_save
Drupal7Backend::filter_get_filters public function Overrides BackendInterface::filter_get_filters
Drupal7Backend::filter_list_format public function Overrides BackendInterface::filter_list_format
Drupal7Backend::filter_permission_name public function Overrides BackendInterface::filter_permission_name
Drupal7Backend::image_default_style_revert public function Overrides BackendInterface::image_default_style_revert
Drupal7Backend::image_effect_delete public function Overrides BackendInterface::image_effect_delete
Drupal7Backend::image_effect_save public function Overrides BackendInterface::image_effect_save
Drupal7Backend::image_styles public function Overrides BackendInterface::image_styles
Drupal7Backend::image_style_delete public function Overrides BackendInterface::image_style_delete
Drupal7Backend::image_style_flush public function Overrides BackendInterface::image_style_flush
Drupal7Backend::image_style_load public function Overrides BackendInterface::image_style_load
Drupal7Backend::language_list public function Overrides BackendInterface::language_list
Drupal7Backend::language_removeFromDatabase public function Overrides BackendInterface::language_removeFromDatabase
Drupal7Backend::language_writeToDatabase public function Overrides BackendInterface::language_writeToDatabase
Drupal7Backend::locale_add_language public function Overrides BackendInterface::locale_add_language
Drupal7Backend::locale_language_list public function Overrides BackendInterface::locale_language_list
Drupal7Backend::locale_rebuild_js public function Overrides BackendInterface::locale_rebuild_js
Drupal7Backend::menu_delete public function Overrides BackendInterface::menu_delete
Drupal7Backend::menu_getIdentifiers public function Overrides BackendInterface::menu_getIdentifiers
Drupal7Backend::menu_load public function Overrides BackendInterface::menu_load
Drupal7Backend::menu_save public function Overrides BackendInterface::menu_save
Drupal7Backend::module_exists public function Overrides BackendInterface::module_exists
Drupal7Backend::module_invoke_all public function Overrides BackendInterface::module_invoke_all
Drupal7Backend::node_type_delete public function Overrides BackendInterface::node_type_delete
Drupal7Backend::node_type_get_names public function Overrides BackendInterface::node_type_get_names
Drupal7Backend::node_type_get_type public function Overrides BackendInterface::node_type_get_type
Drupal7Backend::node_type_save public function Overrides BackendInterface::node_type_save
Drupal7Backend::permission_deletePermission public function Overrides BackendInterface::permission_deletePermission
Drupal7Backend::permission_savePermission public function Overrides BackendInterface::permission_savePermission
Drupal7Backend::role_export_roles public function Overrides BackendInterface::role_export_roles
Drupal7Backend::role_roleExists public function Overrides BackendInterface::role_roleExists
Drupal7Backend::taxonomy_get_vocabularies public function Overrides BackendInterface::taxonomy_get_vocabularies
Drupal7Backend::taxonomy_vocabulary_delete public function Overrides BackendInterface::taxonomy_vocabulary_delete
Drupal7Backend::taxonomy_vocabulary_machine_name_load public function Overrides BackendInterface::taxonomy_vocabulary_machine_name_load
Drupal7Backend::taxonomy_vocabulary_save public function Overrides BackendInterface::taxonomy_vocabulary_save
Drupal7Backend::text_format_getFilterFormat public function Overrides BackendInterface::text_format_getFilterFormat
Drupal7Backend::user_permission_get_modules public function Overrides BackendInterface::user_permission_get_modules
Drupal7Backend::user_role_delete public function Overrides BackendInterface::user_role_delete
Drupal7Backend::user_role_permissions public function Overrides BackendInterface::user_role_permissions
Drupal7Backend::user_role_save public function Overrides BackendInterface::user_role_save
Drupal7Backend::variable_del public function Overrides BackendInterface::variable_del
Drupal7Backend::variable_get public function Overrides BackendInterface::variable_get
Drupal7Backend::variable_getIdentifiers public function Overrides BackendInterface::variable_getIdentifiers
Drupal7Backend::variable_set public function Overrides BackendInterface::variable_set
Drupal7Backend::views_delete_view public function Overrides BackendInterface::views_delete_view
Drupal7Backend::views_get_view public function Overrides BackendInterface::views_get_view
Drupal7Backend::views_new_view public function Overrides BackendInterface::views_new_view
Drupal7Backend::views_save_view public function Overrides BackendInterface::views_save_view
Drupal7Backend::view_getIdentifiers public function Overrides BackendInterface::view_getIdentifiers
Drupal7Backend::wysiwyg_get_profile public function Overrides BackendInterface::wysiwyg_get_profile
Drupal7Backend::wysiwyg_profile_cache_clear public function Overrides BackendInterface::wysiwyg_profile_cache_clear
Drupal7Backend::wysiwyg_profile_delete public function Overrides BackendInterface::wysiwyg_profile_delete
Drupal7Backend::wysiwyg_profile_load_all public function Overrides BackendInterface::wysiwyg_profile_load_all
Drupal7Backend::wysiwyg_saveProfile public function Overrides BackendInterface::wysiwyg_saveProfile