You are here

public function ChangeOgMembershipStateBase::execute in Organic groups 8

Executes the plugin.

Overrides ExecutableInterface::execute

File

src/Plugin/Action/ChangeOgMembershipStateBase.php, line 59

Class

ChangeOgMembershipStateBase
Base class for actions that change the state of a membership.

Namespace

Drupal\og\Plugin\Action

Code

public function execute(?OgMembership $membership = NULL) {
  if (!$membership) {
    return;
  }
  $membership
    ->setState($this
    ->getTargetState())
    ->save();
}