You are here

class MediaExpireCommands in Media Expire 8.2

Defines Drush commands for the media_expire module.

Hierarchy

Expanded class hierarchy of MediaExpireCommands

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

File

src/Commands/MediaExpireCommands.php, line 11

Namespace

Drupal\media_expire\Commands
View source
class MediaExpireCommands extends DrushCommands {

  /**
   * The media expire service.
   *
   * @var \Drupal\media_expire\MediaExpireService
   */
  protected $mediaExpireService;

  /**
   * MediaExpireCommands constructor.
   *
   * @param \Drupal\media_expire\MediaExpireService $media_expire_service
   *   The media expire service.
   */
  public function __construct(MediaExpireService $media_expire_service) {
    parent::__construct();
    $this->mediaExpireService = $media_expire_service;
  }

  /**
   * Checks for expired media.
   *
   * @command media:expire-check
   * @aliases mec,media-expire-check
   */
  public function expireCheck() {
    $this->mediaExpireService
      ->unpublishExpiredMedia();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MediaExpireCommands::$mediaExpireService protected property The media expire service.
MediaExpireCommands::expireCheck public function Checks for expired media.
MediaExpireCommands::__construct public function MediaExpireCommands constructor.