You are here

protected function LingotekApi::getCreateWithTargetsParams in Lingotek Translation 7.3

Same name and namespace in other branches
  1. 7.2 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::getCreateWithTargetsParams()
  2. 7.4 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::getCreateWithTargetsParams()

Collects the entity-specific parameter values for a document create API call.

Parameters

LingotekTranslatableEntity: A Drupal entity.

Return value

array An array of parameters ready to send to a createContentDocumentWithTargets API call.

1 call to LingotekApi::getCreateWithTargetsParams()
LingotekApi::addContentDocumentWithTargets in lib/Drupal/lingotek/LingotekApi.php
Adds a Document and one or more Translation Targets to the Lingotek platform. (used by comments and config chunks currently)

File

lib/Drupal/lingotek/LingotekApi.php, line 223
Defines Drupal\lingotek\LingotekApi

Class

LingotekApi
@file Defines Drupal\lingotek\LingotekApi

Code

protected function getCreateWithTargetsParams(LingotekTranslatableEntity $entity) {
  $parameters = array();
  switch (get_class($entity)) {
    case 'LingotekComment':
      $parameters = $this
        ->getCommentCreateWithTargetsParams($entity);
      break;
    case 'LingotekConfigChunk':
      $parameters = $this
        ->getConfigChunkCreateWithTargetsParams($entity);
      break;
    case 'LingotekNode':
    default:
      throw new Exception("createContentDocumentWithTargets not implemented for type '" . get_class($entity) . "'.");
      break;
  }
  return $parameters;
}