You are here

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

Executes the plugin.

Overrides ExecutableInterface::execute

File

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

Class

PublishUnit
Publishes a unit.

Namespace

Drupal\bat_unit\Plugin\Action

Code

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