Beispiel #1
0
 /**
  * Adapt our query for translations.
  *
  * @param \Drupal\Core\Database\Query\SelectInterface
  *   The generated query.
  */
 protected function handleTranslations(SelectInterface $query)
 {
     // Check whether or not we want translations.
     if (empty($this->configuration['translations'])) {
         // No translations: Yield untranslated nodes, or default translations.
         $query->where('n.tnid = 0 OR n.tnid = n.nid');
     } else {
         // Translations: Yield only non-default translations.
         $query->where('n.tnid <> 0 AND n.tnid <> n.nid');
     }
 }
Beispiel #2
0
 public function where($snippet, $args = array())
 {
     $this->query->where($snippet, $args);
     return $this;
 }