You are here

abstract class TranslationSubmissionParamsAbstract in TMGMT Translator Smartling 8.4

Same name and namespace in other branches
  1. 8.3 vendor/smartling/api-sdk-php/src/TranslationRequests/Params/TranslationSubmissionParamsAbstract.php \Smartling\TranslationRequests\Params\TranslationSubmissionParamsAbstract

Class TranslationSubmissionParamsAbstract @package Smartling\TranslationRequests\Params

Hierarchy

Expanded class hierarchy of TranslationSubmissionParamsAbstract

File

vendor/smartling/api-sdk-php/src/TranslationRequests/Params/TranslationSubmissionParamsAbstract.php, line 9

Namespace

Smartling\TranslationRequests\Params
View source
abstract class TranslationSubmissionParamsAbstract extends ParamsAbstract {

  /**
   * @param array $targetAssetKey
   * @return $this
   */
  public function setTargetAssetKey(array $targetAssetKey = []) {
    $this
      ->set('targetAssetKey', $targetAssetKey);
    return $this;
  }

  /**
   * @param $state
   * @return $this
   */
  public function setState($state) {
    $state = (string) $state;
    if (in_array($state, TranslationSubmissionStates::$allowedStates, true)) {
      $this
        ->set('state', $state);
    }
    else {
      throw new \UnexpectedValueException(vsprintf('Invalid \'state\' value \'%s\', expected one of: %s', [
        $state,
        implode('|', TranslationSubmissionStates::$allowedStates),
      ]));
    }
    return $this;
  }

  /**
   * @param $submitterName
   * @return $this
   */
  public function setSubmitterName($submitterName) {
    $this
      ->set('submitterName', (string) $submitterName);
    return $this;
  }

  /**
   * @param array $customTranslationData
   * @return $this
   */
  public function setCustomTranslationData(array $customTranslationData = []) {
    $this
      ->set('customTranslationData', $customTranslationData);
    return $this;
  }

  /**
   * @param \DateTime $submittedDate
   * @return $this
   */
  public function setSubmittedDate(\DateTime $submittedDate) {
    $this
      ->set('submittedDate', $submittedDate
      ->format(static::DATE_TIME_FORMAT));
    return $this;
  }

  /**
   * @param \DateTime $lastExportDate
   * @return $this
   */
  public function setLastExportedDate(\DateTime $lastExportDate) {
    $this
      ->set('lastExportedDate', $lastExportDate
      ->format(static::DATE_TIME_FORMAT));
    return $this;
  }

  /**
   * @param $lastErrorMessage
   * @return $this
   */
  public function setLastErrorMessage($lastErrorMessage) {
    $this
      ->set('lastErrorMessage', (string) $lastErrorMessage);
    return $this;
  }

}

Members