You are here

public function VariablesSet::remove in Business Rules 8

Same name and namespace in other branches
  1. 2.x src/VariablesSet.php \Drupal\business_rules\VariablesSet::remove()

Remove one variable from the variables set.

Parameters

string $variable_id: The variable id.

File

src/VariablesSet.php, line 66

Class

VariablesSet
Class VariablesSet to be returned on each BusinessRulesVariable plugin.

Namespace

Drupal\business_rules

Code

public function remove($variable_id) {
  if ($this
    ->count()) {
    foreach ($this->variables as $key => $variable) {
      if ($variable
        ->getId() == $variable_id) {
        unset($this->variables[$key]);
      }
    }
  }
}