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\ActionCode
public function execute($entity = NULL) {
$entity->status = 0;
$entity
->save();
}