You are here

public function ActivateConnection::execute in RedHen CRM 8

Executes the plugin.

Overrides ExecutableInterface::execute

File

modules/redhen_connection/src/Plugin/Action/ActivateConnection.php, line 22

Class

ActivateConnection
Activates a Connection.

Namespace

Drupal\redhen_connection\Plugin\Action

Code

public function execute($connection = NULL) {

  // Skip activating the connection already active.
  if ($connection !== FALSE && !$connection
    ->isActive()) {
    $connection
      ->setActive(TRUE);
    $connection
      ->save();
  }
}