You are here

public function WebformEntityReferenceManager::hasField in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformEntityReferenceManager.php \Drupal\webform\WebformEntityReferenceManager::hasField()

Determine if the entity has a webform entity reference field.

Parameters

\Drupal\Core\Entity\EntityInterface|null $entity: A fieldable content entity.

Return value

bool TRUE if the entity has a webform entity reference field.

Overrides WebformEntityReferenceManagerInterface::hasField

File

src/WebformEntityReferenceManager.php, line 169

Class

WebformEntityReferenceManager
Webform entity reference (field) manager.

Namespace

Drupal\webform

Code

public function hasField(EntityInterface $entity = NULL) {
  return $this
    ->getFieldName($entity) ? TRUE : FALSE;
}