You are here

protected function SetCustomPublishingOption::doExecute in Custom Publishing Options 8

Sets the custom publishing option on a given entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to be saved.

\Drupal\custom_pub\CustomPublishingOptionInterface $custom_publish_option: The option to set.

File

src/Plugin/RulesAction/SetCustomPublishingOption.php, line 38

Class

SetCustomPublishingOption
Provides an action to trigger a custom publishing option.

Namespace

Drupal\custom_pub\Plugin\RulesAction

Code

protected function doExecute(EntityInterface $entity, CustomPublishingOptionInterface $custom_publish_option) {
  $entity->{$custom_publish_option
    ->id()} = TRUE;
}