class GatsbyFastbuildsCommands in Gatsby Live Preview & Incremental Builds 8
Same name and namespace in other branches
- 2.0.x modules/gatsby_fastbuilds/src/Commands/GatsbyFastbuildsCommands.php \Drupal\gatsby_fastbuilds\Commands\GatsbyFastbuildsCommands
A drush command file.
@package Drupal\gatsby_fastbuilds\Commands
Hierarchy
- class \Drupal\gatsby_fastbuilds\Commands\GatsbyFastbuildsCommands extends \Drush\Commands\DrushCommands
Expanded class hierarchy of GatsbyFastbuildsCommands
1 string reference to 'GatsbyFastbuildsCommands'
- drush.services.yml in modules/
gatsby_fastbuilds/ drush.services.yml - modules/gatsby_fastbuilds/drush.services.yml
1 service uses GatsbyFastbuildsCommands
- gatsby_fastbuilds.commands in modules/
gatsby_fastbuilds/ drush.services.yml - \Drupal\gatsby_fastbuilds\Commands\GatsbyFastbuildsCommands
File
- modules/
gatsby_fastbuilds/ src/ Commands/ GatsbyFastbuildsCommands.php, line 14
Namespace
Drupal\gatsby_fastbuilds\CommandsView source
class GatsbyFastbuildsCommands extends DrushCommands {
/**
* Drupal\gatsby_fastbuilds\GatsbyEntityLogger definition.
*
* @var \Drupal\gatsby_fastbuilds\GatsbyEntityLogger
*/
protected $gatsbyLogger;
/**
* Drupal\Core\State\StateInterface definition.
*
* @var \Drupal\State\State\StateInterface
*/
protected $state;
/**
* Constructs a new GatsbyFastbuildsCommands object.
*/
public function __construct(GatsbyEntityLogger $gatsby_logger, StateInterface $state) {
parent::__construct();
$this->gatsbyLogger = $gatsby_logger;
$this->state = $state;
}
/**
* Drush command that deletes all the Gatsby Fastbuilds Log entries.
*
* @command gatsby_fastbuilds:delete
* @aliases gatsdel
* @usage gatsby_fastbuilds:delete
*/
public function delete() {
$time = time();
$this->gatsbyLogger
->deleteExpiredLoggedEntities($time);
// Store the log time in order to validate future syncs.
$this->state
->set('gatsby_fastbuilds.last_logtime', $time);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GatsbyFastbuildsCommands:: |
protected | property | Drupal\gatsby_fastbuilds\GatsbyEntityLogger definition. | |
GatsbyFastbuildsCommands:: |
protected | property | Drupal\Core\State\StateInterface definition. | |
GatsbyFastbuildsCommands:: |
public | function | Drush command that deletes all the Gatsby Fastbuilds Log entries. | |
GatsbyFastbuildsCommands:: |
public | function | Constructs a new GatsbyFastbuildsCommands object. |