leftjoin example

'bundle',
        'data',
        'deleted',
      ])
      ->condition('i18n.textgroup', 'field');
    $condition = $query->orConditionGroup()
      ->condition('textgroup', 'field')
      ->condition('objectid', '#allowed_values', '!=');
    $query->condition($condition);
    $query->innerJoin('locales_target', 'lt', '[lt].[lid] = [i18n].[lid]');

    $query->leftjoin('field_config_instance', 'fci', '[fci].[bundle] = [i18n].[objectid] AND [fci].[field_name] = [i18n].[type]');
    return $query;
  }

  /** * {@inheritdoc} */
  public function fields() {
    return [
      'lid' => $this->t('Locales target language ID.'),
      'textgroup' => $this->t('A module defined group of translations'),
      'context' => $this->t('Full string ID for quick search: type:objectid:property.'),
      
    $query = $this->select('i18n_strings', 'i18n')
      ->fields('i18n')
      ->fields('lt', [
        'translation',
        'language',
        'plid',
        'plural',
      ])
      ->condition('i18n.type', 'field')
      ->condition('property', 'option\_%', 'LIKE');
    $query->innerJoin('locales_target', 'lt', '[lt].[lid] = [i18n].[lid]');
    $query->leftjoin('content_node_field', 'cnf', '[cnf].[field_name] = [i18n].[objectid]');
    $query->addField('cnf', 'field_name');
    $query->addField('cnf', 'global_settings');
    // Minimise changes to the d6_field_option_translation.yml, which is copied     // from d6_field.yml, by ensuring the 'type' property is from     // content_node_field table.     $query->addField('cnf', 'type');
    $query->addField('i18n', 'type', 'i18n_type');

    // The i18n_string module adds a status column to locale_target. It was     // originally 'status' in a later revision it was named 'i18n_status'.     /** @var \Drupal\Core\Database\Schema $db */
    

class VocabularyTranslation extends Vocabulary {

  /** * {@inheritdoc} */
  public function query() {
    $query = parent::query();
    $query->leftjoin('i18n_string', 'i18n', 'CAST ([v].[vid] AS CHAR(222)) = [i18n].[objectid]');
    $query->innerJoin('locales_target', 'lt', '[lt].[lid] = [i18n].[lid]');
    $query
      ->condition('type', 'vocabulary')
      ->fields('lt')
      ->fields('i18n');
    $query->addField('lt', 'lid', 'lt_lid');

    if ($this->getDatabase()
      ->schema()
      ->fieldExists('taxonomy_vocabulary', 'language')) {
      $query->addField('v', 'language', 'v_language');
    }
/** * {@inheritdoc} */
  public function query() {
    $query = parent::query();
    $query
      ->fields('i18n', ['property', 'objectid'])
      ->fields('lt', ['translation', 'language'])
      ->condition('i18n.type', 'field')
      ->condition('property', 'options');
    $query->leftjoin('i18n_strings', 'i18n', '[pf].[name] = [i18n].[objectid]');
    $query->innerJoin('locales_target', 'lt', '[lt].[lid] = [i18n].[lid]');

    return $query;
  }

  /** * {@inheritdoc} */
  public function fields() {
    return parent::fields() +
      [
        
'cache',
        'i18n_mode',
      ])
      ->fields('lt', [
        'lid',
        'translation',
        'language',
        'plid',
        'plural',
      ])
      ->condition('i18n_mode', 1);
    $query->leftjoin($this->blockTable, 'b', ('[b].[delta] = [i18n].[objectid]'));
    $query->innerJoin('locales_target', 'lt', '[lt].[lid] = [i18n].[lid]');

    // The i18n_string module adds a status column to locale_target. It was     // originally 'status' in a later revision it was named 'i18n_status'.     /** @var \Drupal\Core\Database\Schema $db */
    if ($this->getDatabase()->schema()->fieldExists('locales_target', 'status')) {
      $query->addField('lt', 'status', 'i18n_status');
    }
    if ($this->getDatabase()->schema()->fieldExists('locales_target', 'i18n_status')) {
      $query->addField('lt', 'i18n_status', 'i18n_status');
    }

    
Home | Imprint | This part of the site doesn't use cookies.