You are here

public function DateRecurCachedHooks::fieldInfoAlter in Recurring Dates Field 3.1.x

Same name and namespace in other branches
  1. 8.2 src/DateRecurCachedHooks.php \Drupal\date_recur\DateRecurCachedHooks::fieldInfoAlter()
  2. 3.x src/DateRecurCachedHooks.php \Drupal\date_recur\DateRecurCachedHooks::fieldInfoAlter()
  3. 3.0.x src/DateRecurCachedHooks.php \Drupal\date_recur\DateRecurCachedHooks::fieldInfoAlter()

Implements hook_field_info_alter().

See also

\hook_field_info_alter()

\date_recur_field_info_alter()

File

src/DateRecurCachedHooks.php, line 22

Class

DateRecurCachedHooks
Defines hooks that run when caches need to be rebuilt.

Namespace

Drupal\date_recur

Code

public function fieldInfoAlter(array &$info) : void {
  foreach ($info as &$definition) {
    $class = $definition['class'];

    // Is date_recur or a subclass.
    if ($class == DateRecurItem::class || (new \ReflectionClass($class))
      ->isSubclassOf(DateRecurItem::class)) {
      $definition[DateRecurOccurrences::IS_DATE_RECUR] = 'TRUE';
    }
  }
}