addLanguageFallback example

$select = $this->getBaseQuery()
      ->fields('base_table', ['path', 'alias']);

    if (!empty($preloaded)) {
      $conditions = $this->connection->condition('OR');
      foreach ($preloaded as $preloaded_item) {
        $conditions->condition('base_table.path', $this->connection->escapeLike($preloaded_item), 'LIKE');
      }
      $select->condition($conditions);
    }

    $this->addLanguageFallback($select$langcode);

    // We order by ID ASC so that fetchAllKeyed() returns the most recently     // created alias for each source. Subsequent queries using fetchField() must     // use ID DESC to have the same effect.     $select->orderBy('base_table.id', 'ASC');

    return $select->execute()->fetchAllKeyed();
  }

  /** * {@inheritdoc} */
Home | Imprint | This part of the site doesn't use cookies.