You are here

public static function FieldHelper::hasDelta in Helper 7

1 call to FieldHelper::hasDelta()
FieldHelperTestCase::testValues in tests/FieldHelperTestCase.test

File

lib/FieldHelper.php, line 38

Class

FieldHelper

Code

public static function hasDelta($entity_type, $entity, $field_name, $delta) {
  if (!empty($entity->{$field_name}) && ($items = field_get_items($entity_type, $entity, $field_name))) {
    return !empty($items[$delta]);
  }
}