bt_personas-2.0.0-alpha2/bt_personas.install

bt_personas.install
<?php

/**
 * @file
 * Install functions for bt_personas.
 */

/**
 * Implements hook_install().
 */
function bt_personas_install() {
  [
    $entity_field_manager,
    $field_storage_definition_listener,
  ] = _personas_get_install_dependencies();

  $definitions = $entity_field_manager->getFieldStorageDefinitions('user');
  $field_storage_definition_listener->onFieldStorageDefinitionCreate($definitions['personas']);
}

/**
 * Helper function to load install dependencies.
 */
function _personas_get_install_dependencies() {
  $container = \Drupal::getContainer();
  return [
    $container->get('entity_field.manager'),
    $container->get('field_storage_definition.listener'),
  ];
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc