You are here

public function FieldableEdgeEntityBase::hasField in Apigee Edge 8

Determines whether the entity has a field with the given name.

Parameters

string $field_name: The field name.

Return value

bool TRUE if the entity has a field with the given name. FALSE otherwise.

Overrides FieldableEntityInterface::hasField

1 call to FieldableEdgeEntityBase::hasField()
FieldableEdgeEntityBase::set in src/Entity/FieldableEdgeEntityBase.php
Sets a field value.

File

src/Entity/FieldableEdgeEntityBase.php, line 355

Class

FieldableEdgeEntityBase
Base field support for Apigee Entities without making them content entities.

Namespace

Drupal\apigee_edge\Entity

Code

public function hasField($field_name) {
  return (bool) $this
    ->getFieldDefinition($field_name);
}