You are here

private function Replicator::dispatchEventCloneEntityField in Replicate 8

Fires events for a single field of a fieldable entity.

Parameters

\Drupal\Core\Entity\FieldableEntityInterface $clone: The cloned fieldable entity.

$field_name: The field name.

\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The field definition.

2 calls to Replicator::dispatchEventCloneEntityField()
Replicator::dispatchEventCloneEntityFields in src/Replicator.php
Fires events for each field of a fieldable entity.
Replicator::postCloneEntityField in src/Replicator.php
Postprocess a cloned entity field.

File

src/Replicator.php, line 222

Class

Replicator
Class Replicator. Manages the replication of an entity.

Namespace

Drupal\replicate

Code

private function dispatchEventCloneEntityField(FieldableEntityInterface $clone, $field_name, FieldDefinitionInterface $field_definition) {
  $event = new ReplicateEntityFieldEvent($clone
    ->get($field_name), $clone);
  $this->eventDispatcher
    ->dispatch(ReplicatorEvents::replicateEntityField($field_definition
    ->getType()), $event);
}