User.php 942 Bytes
Newer Older
1 2 3
<?php
/**
 * @file
gbyte's avatar
gbyte committed
4
 * Contains \Drupal\simple_sitemap\Plugin\LinkGenerator\User.
5 6 7 8
 *
 * Plugin for user link generation.
 */

gbyte's avatar
gbyte committed
9
namespace Drupal\simple_sitemap\Plugin\LinkGenerator;
10

gbyte's avatar
gbyte committed
11 12
use Drupal\simple_sitemap\Annotation\LinkGenerator;
use Drupal\simple_sitemap\LinkGeneratorBase;
13 14 15 16 17 18 19 20 21 22 23 24 25 26

/**
 * User class.
 *
 * @LinkGenerator(
 *   id = "user",
 *   form_id = "user_admin_settings"
 * )
 */
class User extends LinkGeneratorBase {

  /**
   * {@inheritdoc}
   */
27 28
  public function getInfo() {
    array(
gbyte's avatar
gbyte committed
29 30 31 32 33 34 35
      'field_info' => array(
        'entity_id' => 'uid',
        'lastmod' => 'changed',
      ),
      'path_info' => array(
        'route_name' => 'entity.user.canonical',
        'entity_type' => 'user',
36 37 38 39 40 41 42 43 44 45 46
      )
    );
  }

  /**
   * {@inheritdoc}
   */
  public function getQuery($bundle) {
    return \Drupal::database()->select('users_field_data', 'u')
      ->fields('u', array('uid', 'changed'))
      ->condition('status', 1);
47
  }
48

49
}