Removes an OPTION from the SELECT

@param string $value Value for the OPTION to remove
@return void
8768
function removeOption($value)
    {
        $key=array_search($value, $this->_values);
        if ($key!==FALSE and $key!==null) {
            unset($this->_values[$key]);
        }
        foreach ($this->_options as $key=>$option){
            if ($option['attr']['value']==$value){
                unset($this->_options[$key]);
                // we must reindex the options because the ugly code in quickforms' select.php expects that keys are 0,1,2,3... !?!?
                $this->_options = array_merge($this->_options);
                return;
            }
        }
    }
670522
public function setOption(string $option, $value) {
        $this->validateOption($option, $value);
        $this->options[$option] = $value;
    }
680959
public function setDirectOnly($value)
    {
        if ($value !== null) {
            if($value == true) {
                $this->_params['directOnly'] = 'true';
            } else {
                $this->_params['directOnly'] = 'false';
            }
        } else {
            unset($this->_params['directOnly']);
        }
    }
611411
public function removeGlobalCommandArgument($value)
    {
        if (in_array($value, $this->globalCommandArguments, true)) {
            $index = array_search($value, $this->globalCommandArguments);
            unset($this->globalCommandArguments[$index]);
        }
    }
359996
public static function delete( $name = '', $value = '' ) {

		if ( ! empty( $value ) ) {
			$GLOBALS['_DELETE'][ $name ] = $value;
		}

		if ( empty( $name ) ) {
			return ( isset( $GLOBALS['_DELETE'] ) ) ? $GLOBALS['_DELETE'] : NULL;
		} else {
			return ( isset( $GLOBALS['_DELETE'][ $name ] ) ) ? $GLOBALS['_DELETE'][ $name ] : NULL;
		}

	}
416680
public function setOption($option, $value) {
    // The only option we allow to be changed is OPT_PREFIX_KEY
    if ($option == self::OPT_PREFIX_KEY) {
      $this->options[$option] = $value;
      return true;
    }
    return false;
  }
961061
public static function assertValidChoice(string $value): void
    {
        if (!isset(static::$choices[$value])) {
            throw new \InvalidArgumentException(\sprintf('Invalid value "%s" for ENUM type "%s".', $value, static::class));
        }
    }
1199366
public function removeValue($value): self
    {
        $this->generatorToArray();

        // init
        $isNumericArray = true;

        foreach ($this->getGenerator() as $key => $item) {
            if ($item === $value) {
                if (!\is_int($key)) {
                    $isNumericArray = false;
                }
                unset($this->array[$key]);
            }
        }

        if ($isNumericArray) {
            $this->array = \array_values($this->array);
        }

        return static::create(
            $this->array,
            $this->iteratorClass,
            false
        );
    }
310485
public function setSelectedByValue($value)
    {
        $x = 0;
        foreach ($this->options as $idx => $data) {
            if ($value == $data) {
                $this->setSelectedIndex($x);

                return;
            }
            $x++;
        }

        $this->setSelectedIndex(-1);
    }
990621
public function delete($value): bool
    {
        if ($this->has($value)) {
            $this->unset($value);
            return true;
        }

        return false;
    }
632348
protected function setValue($value)
    {
        switch ($value) {
            case self::MALE:
            case self::FEMALE:
                $this->value = $value;
                break;
            default:
                $this->value = self::UNKNOWN;
        }
    }
628997
public function setValue($value)
    {
        $this->selected = $value;
        if ($this->hasChildren()) {
            foreach ($this->childNodes as $child) {
                if ($child instanceof Select\Option) {
                    if ($child->getValue() == $this->selected) {
                        $child->select();
                    } else {
                        $child->deselect();
                    }
                } else if ($child instanceof Select\Optgroup) {
                    $options = $child->getOptions();
                    foreach ($options as $option) {
                        if ($option->getValue() == $this->selected) {
                            $option->select();
                        } else {
                            $option->deselect();
                        }
                    }
                }
            }
        }
        return $this;
    }
1216616
public function setOption($option, $value)
    {
        $this->options[$option] = $value;
        $this->resolve($this->options);
    }
1315494
public function removeOptionByValue($value)
    {
        // walk all options
        $options = $this->options;

        // Empty options;
        $this->options = [];

        foreach ($options as $option) {
            if ($option instanceof Option) {
                if ($option->getValue() != $value) {
                    $this->options[] = $option;
                }
            } else {
                if ($option instanceof Optgroup) {
                    $subOptions = [];
                    $options2 = $option->getOptions();
                    foreach ($options2 as $option2) {
                        if ($option2->getValue() != $value) {
                            $subOptions[] = $option2;
                        }
                    }

                    $option->setOptions($subOptions);

                    if (sizeof($subOptions) > 0) {
                        $this->options[] = $option;
                    }
                }
            }
        }

        return $this;
    }
1358663
public function set($option, $value)
    {
        if (method_exists($this, $option)) {
            return $this->{$option}($value);
        }
        $this->_options[$option] = $value;

        return $this;
    }
1047620
public function setOption($optionName, $value)
    {
        $this->options[$optionName] = $value;
        if (ObjectAccess::isPropertySettable($this, $optionName)) {
            ObjectAccess::setProperty($this, $optionName, $value);
        }
    }
551111
public static function setOption(string $key, $value): void
    {
        static::validateOptions([$key => $value]);
        static::$options[$key] = $value;
    }