You are here

public static function FieldHelper::getEntityReferencingFieldsByType in Helper 7

1 call to FieldHelper::getEntityReferencingFieldsByType()
EntityHelper::getAllReferencesTo in lib/EntityHelper.php

File

lib/FieldHelper.php, line 152

Class

FieldHelper

Code

public static function getEntityReferencingFieldsByType($entity_type) {
  $results = static::getEntityReferencingFields();
  return array_filter($results, function ($columns) use ($entity_type) {
    foreach ($columns as $column => $column_entity_type) {
      if ($column_entity_type == $entity_type) {
        return TRUE;
      }
    }
    return FALSE;
  });
}