You are here

protected function ConditionEditForm::prepareCondition in Block Visibility Groups 8

Prepares the condition used by this form.

Parameters

string $condition_id: Either a condition ID, or the plugin ID used to create a new condition.

Return value

\Drupal\Core\Condition\ConditionInterface The condition object.

Overrides ConditionFormBase::prepareCondition

File

src/Form/ConditionEditForm.php, line 20

Class

ConditionEditForm
Provides a form for editing an condition.

Namespace

Drupal\block_visibility_groups\Form

Code

protected function prepareCondition($condition_id) {

  // Load the condition directly from the block_visibility_group entity.
  return $this->block_visibility_group
    ->getCondition($condition_id);
}