You are here

function lingotek_admin_get_nids_by_profile in Lingotek Translation 7.4

1 call to lingotek_admin_get_nids_by_profile()
lingotek_admin_profile_form_submit in ./lingotek.admin.inc

File

./lingotek.admin.inc, line 369

Code

function lingotek_admin_get_nids_by_profile($id) {
  $query = db_select('node', 'n');
  $query
    ->fields('n', array(
    'nid',
  ));
  $query
    ->leftJoin('lingotek', 'l_profile', 'n.nid = l_profile.nid  and l_profile.lingokey = \'profile\'');
  $query
    ->leftJoin('lingotek', 'l_auto_upload', 'n.nid = l_auto_upload.nid  and l_auto_upload.lingokey = \'create_lingotek_document\'');
  $query
    ->leftJoin('lingotek', 'l_status', 'n.nid = l_status.nid  and l_status.lingokey = \'node_sync_status\'');
  $query
    ->condition('l_status.lingovalue', 'TARGET', '<>');
  $or = lingotek_profile_condition('n', 'l_auto_upload', 'l_profile', $id);
  $query
    ->condition($or);
  return $query
    ->execute()
    ->fetchCol();
}