You are here

function content_lock_entity_type_build in Content locking (anti-concurrent editing) 8

Same name and namespace in other branches
  1. 8.2 content_lock.module \content_lock_entity_type_build()

Implements hook_entity_type_build().

File

./content_lock.module, line 36
Content lock - Main functions of the module.

Code

function content_lock_entity_type_build(array &$entity_types) {
  foreach ($entity_types as &$entity_type) {
    if ($entity_type instanceof ContentEntityTypeInterface) {
      if (!$entity_type
        ->hasHandlerClass('break_lock_form')) {
        $entity_type
          ->setHandlerClass('break_lock_form', '\\Drupal\\content_lock\\Form\\EntityBreakLockForm');
      }
    }
  }
}