You are here

function yoast_seo_entity_type_build in Real-time SEO for Drupal 8.2

Implements hook_entity_type_build().

Sets the default yoast_seo_form form handler to all entity types.

See also

\Drupal\Core\Entity\Annotation\EntityType

File

./yoast_seo.module, line 88
Contains yoast_seo.module.

Code

function yoast_seo_entity_type_build(array &$entity_types) {

  /* @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
  foreach ($entity_types as &$entity_type) {
    if (!$entity_type
      ->hasHandlerClass('yoast_seo_preview_form')) {
      $entity_type
        ->setHandlerClass('yoast_seo_preview_form', AnalysisFormHandler::class);
    }
  }
}