You are here

public function EntityTypeInfo::entityTypeBuild in Workspace 8.2

Same name and namespace in other branches
  1. 8 src/EntityTypeInfo.php \Drupal\workspace\EntityTypeInfo::entityTypeBuild()

Adds the "EntityWorkspaceConflict" constraint to eligible entity types.

Parameters

\Drupal\Core\Entity\EntityTypeInterface[] $entity_types: An associative array of all entity type definitions, keyed by the entity type name. Passed by reference.

See also

hook_entity_type_build()

File

src/EntityTypeInfo.php, line 65

Class

EntityTypeInfo
Manipulates entity type information.

Namespace

Drupal\workspace

Code

public function entityTypeBuild(array &$entity_types) {
  foreach ($entity_types as $entity_type) {
    if ($this->workspaceManager
      ->isEntityTypeSupported($entity_type)) {
      $entity_type
        ->addConstraint('EntityWorkspaceConflict');
    }
  }
}