You are here

function opigno_scorm_entity_bundle_field_info_alter in Opigno SCORM 3.x

Same name and namespace in other branches
  1. 8 opigno_scorm.module \opigno_scorm_entity_bundle_field_info_alter()

Implements hook_entity_bundle_field_info_alter().

File

./opigno_scorm.module, line 423
Module functionality implementation.

Code

function opigno_scorm_entity_bundle_field_info_alter(&$fields, \Drupal\Core\Entity\EntityTypeInterface $entity_type, $bundle) {
  if ($bundle === 'opigno_scorm') {
    if (isset($fields['opigno_scorm_package'])) {

      // Use the ID as defined in the annotation of the constraint definition
      $fields['opigno_scorm_package']
        ->addConstraint('ScormPackage', []);
    }
  }
}