You are here

public function LingotekEntity::setTargetsStatus in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekEntity.php \LingotekEntity::setTargetsStatus()
  2. 7.5 lib/Drupal/lingotek/LingotekEntity.php \LingotekEntity::setTargetsStatus()

Overrides LingotekTranslatableEntity::setTargetsStatus

File

lib/Drupal/lingotek/LingotekEntity.php, line 395
Defines LingotekEntity.

Class

LingotekEntity
A class wrapper for Lingotek-specific behavior on nodes.

Code

public function setTargetsStatus($status, $lingotek_locale = 'all') {
  if ($lingotek_locale != 'all') {
    $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;
}