class UrlAliasBase

Same name and namespace in other branches
  1. 11.x core/modules/path/src/Plugin/migrate/source/UrlAliasBase.php \Drupal\path\Plugin\migrate\source\UrlAliasBase
  2. 10 core/modules/path/src/Plugin/migrate/source/UrlAliasBase.php \Drupal\path\Plugin\migrate\source\UrlAliasBase
  3. 8.9.x core/modules/path/src/Plugin/migrate/source/UrlAliasBase.php \Drupal\path\Plugin\migrate\source\UrlAliasBase

Base class for the url_alias source plugins.

Hierarchy

Expanded class hierarchy of UrlAliasBase

2 files declare their use of UrlAliasBase
UrlAlias.php in core/modules/path/src/Plugin/migrate/source/d6/UrlAlias.php
UrlAlias.php in core/modules/path/src/Plugin/migrate/source/d7/UrlAlias.php

File

core/modules/path/src/Plugin/migrate/source/UrlAliasBase.php, line 10

Namespace

Drupal\path\Plugin\migrate\source
View source
abstract class UrlAliasBase extends DrupalSqlBase {
  
  /**
   * {@inheritdoc}
   */
  public function query() {
    // The order of the migration is significant since
    // \Drupal\path_alias\AliasRepository::lookupPathAlias() orders by pid
    // before returning a result. Postgres does not automatically order by
    // primary key therefore we need to add a specific order by.
    return $this->select('url_alias', 'ua')
      ->fields('ua')
      ->orderBy('pid');
  }
  
  /**
   * {@inheritdoc}
   */
  public function fields() {
    return [
      'pid' => $this->t('The numeric identifier of the path alias.'),
      'language' => $this->t('The language code of the URL alias.'),
    ];
  }
  
  /**
   * {@inheritdoc}
   */
  public function getIds() {
    $ids['pid']['type'] = 'integer';
    return $ids;
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.