flexiform.install in Flexiform 8
Same filename and directory in other branches
Install, update and uninstall functions for the flexiform module.
File
flexiform.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the flexiform module.
*/
/**
* Implements hook_install().
*/
function flexiform_install() {
$manager = \Drupal::entityDefinitionUpdateManager();
// Get hold of our user type definition.
$entity_form_display_type = $manager
->getEntityType('entity_form_display');
// Change the class.
$entity_form_display_type
->setClass('Drupal\\flexiform\\FlexiformEntityFormDisplay');
$entity_form_display_type
->setFormClass('edit', 'Drupal\\flexiform\\Form\\FlexiformEntityFormDisplayEditForm');
$manager
->updateEntityType($entity_form_display_type);
}
/**
* Implements hook_uninstall().
*/
function flexiform_uninstall() {
$manager = \Drupal::entityDefinitionUpdateManager();
// Get hold of our user type definition.
$entity_form_display_type = $manager
->getEntityType('entity_form_display');
// Change the class.
$entity_form_display_type
->setClass('Drupal\\Core\\Entity\\Entity\\EntityFormDisplay');
$entity_form_display_type
->setFormClass('edit', 'Drupal\\field_ui\\Form\\EntityFormDisplayEditForm');
$manager
->updateEntityType($entity_form_display_type);
}
Functions
Name | Description |
---|---|
flexiform_install | Implements hook_install(). |
flexiform_uninstall | Implements hook_uninstall(). |