Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / path / src / Plugin / migrate / source / UrlAliasBase.php
1 <?php
2
3 namespace Drupal\path\Plugin\migrate\source;
4
5 use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
6
7 /**
8  * Base class for the url_alias source plugins.
9  */
10 abstract class UrlAliasBase extends DrupalSqlBase {
11
12   /**
13    * {@inheritdoc}
14    */
15   public function query() {
16     // The order of the migration is significant since
17     // \Drupal\Core\Path\AliasStorage::lookupPathAlias() orders by pid before
18     // returning a result. Postgres does not automatically order by primary key
19     // therefore we need to add a specific order by.
20     return $this->select('url_alias', 'ua')->fields('ua')->orderBy('pid');
21   }
22
23   /**
24    * {@inheritdoc}
25    */
26   public function fields() {
27     return [
28       'pid' => $this->t('The numeric identifier of the path alias.'),
29       'language' => $this->t('The language code of the URL alias.'),
30     ];
31   }
32
33   /**
34    * {@inheritdoc}
35    */
36   public function getIds() {
37     $ids['pid']['type'] = 'integer';
38     return $ids;
39   }
40
41 }