Example #1
0
 /**
  * Remove update from reference field value.
  *
  * @param \Drupal\Core\Entity\ContentEntityInterface $entity
  * @param \Drupal\scheduled_updates\ScheduledUpdateInterface $update
  * @param $field_id
  */
 protected function removeUpdate(ContentEntityInterface $entity, ScheduledUpdateInterface $update, $field_id) {
   $current_update_ids = $this->getEntityReferenceTargetIds($entity,$field_id);
   $new_update_ids = array_diff($current_update_ids, [$update->id()]);
   $entity->get($field_id)->setValue($new_update_ids);
 }