You are here

public function UnpublishUnit::execute in Booking and Availability Management Tools for Drupal 8

Executes the plugin.

Overrides ExecutableInterface::execute

File

modules/bat_unit/src/Plugin/Action/UnpublishUnit.php, line 27
Contains \Drupal\bat_unit\Plugin\Action\UnpublishUnit.

Class

UnpublishUnit
Unpublishes a unit.

Namespace

Drupal\bat_unit\Plugin\Action

Code

public function execute($entity = NULL) {
  $entity->status = 0;
  $entity
    ->save();
}