You are here

public function ChoiceFormField::containsOption in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dom-crawler/Field/ChoiceFormField.php \Symfony\Component\DomCrawler\Field\ChoiceFormField::containsOption()

Checks whether given value is in the existing options.

Parameters

string $optionValue:

array $options:

Return value

bool

1 call to ChoiceFormField::containsOption()
ChoiceFormField::setValue in vendor/symfony/dom-crawler/Field/ChoiceFormField.php
Sets the value of the field.

File

vendor/symfony/dom-crawler/Field/ChoiceFormField.php, line 277

Class

ChoiceFormField
ChoiceFormField represents a choice form field.

Namespace

Symfony\Component\DomCrawler\Field

Code

public function containsOption($optionValue, $options) {
  if ($this->validationDisabled) {
    return true;
  }
  foreach ($options as $option) {
    if ($option['value'] == $optionValue) {
      return true;
    }
  }
  return false;
}