You are here

function merci_entity_bundle_field_info_alter in MERCI (Manage Equipment Reservations, Checkout and Inventory) 8.2

File

./merci.module, line 34

Code

function merci_entity_bundle_field_info_alter(&$fields, \Drupal\Core\Entity\EntityTypeInterface $entity_type, $bundle) {
  foreach ($fields as $name => $field) {
    if ($field instanceof \Drupal\field\Entity\FieldConfig && ($settings = $field
      ->getThirdPartySettings('merci'))) {
      foreach ($settings as $constraint => $setting) {
        $fields[$name]
          ->addConstraint($constraint, $setting);
      }
    }
  }
}