You are here

public function WebformAccessGroup::addEntityId in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_access/src/Entity/WebformAccessGroup.php \Drupal\webform_access\Entity\WebformAccessGroup::addEntityId()

Add entity id to webform access group.

Parameters

string $entity_type: The source entity type.

string $entity_id: The source entity id.

string $field_name: The source entity webform field name.

string $webform_id: The webform id.

Overrides WebformAccessGroupInterface::addEntityId

File

modules/webform_access/src/Entity/WebformAccessGroup.php, line 263

Class

WebformAccessGroup
Defines the webform access group entity.

Namespace

Drupal\webform_access\Entity

Code

public function addEntityId($entity_type, $entity_id, $field_name, $webform_id) {
  $entity = "{$entity_type}:{$entity_id}:{$field_name}:{$webform_id}";
  if (!in_array($entity, $this->entityIds)) {
    $this->entityIds[] = $entity;
  }
  return $this;
}