You are here

public static function LingotekSync::getETNodeIds in Lingotek Translation 7.3

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getETNodeIds()
  2. 7.4 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getETNodeIds()
  3. 7.5 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getETNodeIds()
  4. 7.6 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::getETNodeIds()
1 call to LingotekSync::getETNodeIds()
LingotekSync::getUploadableReport in lib/Drupal/lingotek/LingotekSync.php

File

lib/Drupal/lingotek/LingotekSync.php, line 294
LingotekSync

Class

LingotekSync
A utility class for Lingotek Syncing.

Code

public static function getETNodeIds() {

  // get nids for entity_translation nodes that are not lingotek pushed
  $types = lingotek_translatable_node_types();

  // get all translatable node types
  $et_content_types = array();
  foreach ($types as $type) {
    if (lingotek_managed_by_entity_translation($type)) {

      // test if lingotek_managed_by_entity_translation
      $et_content_types[] = $type;
    }
  }
  if (empty($et_content_types)) {
    return array();
  }
  $nodes = entity_load('node', FALSE, array(
    'type' => $et_content_types,
  ));

  // select nodes with et types
  $et_node_ids = array();
  foreach ($nodes as $node) {
    if (!lingotek_node_pushed($node)) {
      $et_node_ids[] = $node->nid;
    }
  }
  return $et_node_ids;
}