You are here

class SimplesitemapCommands in Simple XML sitemap 8.2

Same name and namespace in other branches
  1. 8.3 src/Commands/SimplesitemapCommands.php \Drupal\simple_sitemap\Commands\SimplesitemapCommands
  2. 4.x src/Commands/SimpleSitemapCommands.php \Drupal\simple_sitemap\Commands\SimpleSitemapCommands

Class SimplesitemapCommands @package Drupal\simple_sitemap\Commands

Hierarchy

Expanded class hierarchy of SimplesitemapCommands

1 string reference to 'SimplesitemapCommands'
drush.services.yml in ./drush.services.yml
drush.services.yml
1 service uses SimplesitemapCommands
simple_sitemap.commands in ./drush.services.yml
\Drupal\simple_sitemap\Commands\SimplesitemapCommands

File

src/Commands/SimplesitemapCommands.php, line 12

Namespace

Drupal\simple_sitemap\Commands
View source
class SimplesitemapCommands extends DrushCommands {

  /**
   * @var \Drupal\simple_sitemap\Simplesitemap
   */
  protected $generator;

  /**
   * SimplesitemapCommands constructor.
   * @param \Drupal\simple_sitemap\Simplesitemap $generator
   */
  public function __construct(Simplesitemap $generator) {
    $this->generator = $generator;
  }

  /**
   * Regenerate the XML sitemap according to the module settings.
   *
   * @command simple-sitemap:generate
   * @validate-module-enabled simple_sitemap
   * @aliases ss:generate, ssg, simple_sitemap:generate, simple_sitemap-generate
   */
  public function generate() {
    $this->generator
      ->generateSitemap('drush');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SimplesitemapCommands::$generator protected property
SimplesitemapCommands::generate public function Regenerate the XML sitemap according to the module settings.
SimplesitemapCommands::__construct public function SimplesitemapCommands constructor.