You are here

public function LingotekConfigSet::setTargetsStatus in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.6 lib/Drupal/lingotek/LingotekConfigSet.php \LingotekConfigSet::setTargetsStatus()

Assign the set's target status(es) in the config metadata table

Overrides LingotekTranslatableEntity::setTargetsStatus

1 call to LingotekConfigSet::setTargetsStatus()
LingotekConfigSet::downloadTriggered in lib/Drupal/lingotek/LingotekConfigSet.php
Updates the local content of $target_code with data from a Lingotek Document

File

lib/Drupal/lingotek/LingotekConfigSet.php, line 714
Defines LingotekConfigSet.

Class

LingotekConfigSet
A class wrapper for Lingotek-specific behavior on ConfigSets.

Code

public function setTargetsStatus($status, $lingotek_locale = NULL) {
  if (is_array($lingotek_locale)) {
    foreach ($lingotek_locale as $ll) {
      $this
        ->setMetadataValue('target_sync_status_' . $ll, $status);
    }
  }
  elseif (is_string($lingotek_locale) && !empty($lingotek_locale)) {
    $this
      ->setMetadataValue('target_sync_status_' . $lingotek_locale, $status);
  }
  else {

    // set status for all available targets
    foreach ($this->language_targets as $lt) {
      $this
        ->setMetadataValue('target_sync_status_' . $lt, $status);
    }
  }
  return $this;
}