예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function rejectDataItem(JobItemInterface $job_item, array $key, array $values = NULL)
 {
     $key = '[' . implode('][', $key) . ']';
     $job_item->addMessage('Rejected data item @key for job item @item in job @job.', array('@key' => $key, '@item' => $job_item->id(), '@job' => $job_item->getJobId()));
     return TRUE;
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function saveTranslation(JobItemInterface $job_item, $target_langcode)
 {
     /* @var \Drupal\Core\Entity\ContentEntityInterface $entity */
     $entity = entity_load($job_item->getItemType(), $job_item->getItemId());
     if (!$entity) {
         $job_item->addMessage('The entity %id of type %type does not exist, the job can not be completed.', array('%id' => $job_item->getItemId(), '%type' => $job_item->getItemType()), 'error');
         return FALSE;
     }
     $data = $job_item->getData();
     $this->doSaveTranslations($entity, $data, $target_langcode);
     return TRUE;
 }