function book_entity_type_build

Same name and namespace in other branches
  1. 9 core/modules/book/book.module \book_entity_type_build()
  2. 8.9.x core/modules/book/book.module \book_entity_type_build()
  3. 10 core/modules/book/book.module \book_entity_type_build()

Implements hook_entity_type_build().

File

core/modules/book/book.module, line 80

Code

function book_entity_type_build(array &$entity_types) {
    
    /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
    $entity_types['node']->setFormClass('book_outline', 'Drupal\\book\\Form\\BookOutlineForm')
        ->setLinkTemplate('book-outline-form', '/node/{node}/outline')
        ->setLinkTemplate('book-remove-form', '/node/{node}/outline/remove')
        ->addConstraint('BookOutline', []);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.