Prepare extra option for form input.

@param array &$options List of options for prepare
@param string|array $listExtraOptions List of extra options.
@param string $optionPrefix Prefix for extra options.
@return void
961802
protected function _prepareExtraOptions(array &$options, $listExtraOptions = [], $optionPrefix = 'data-') {
		if (empty($options) || empty($listExtraOptions)) {
			return;
		}

		if (!is_array($listExtraOptions)) {
			$listExtraOptions = [$listExtraOptions];
		}
		$extraOptions = array_intersect_key($options, array_flip($listExtraOptions));
		if (empty($extraOptions)) {
			return;
		}

		foreach ($extraOptions as $extraOptionName => $extraOptionValue) {
			if (is_bool($extraOptionValue)) {
				if ($extraOptionValue) {
					$extraOptionValue = 'true';
				} else {
					$extraOptionValue = 'false';
				}
			}
			$options[$optionPrefix . $extraOptionName] = $extraOptionValue;
			unset($options[$extraOptionName]);
		}
	}
605774
public function prepareOptions(array $options)
    {
        $optionPieces = [];
        foreach ($options as $opt => $value) {
            //if it's an array of options, throw them in there as well
            if (is_array($value)) {
                foreach ($value as $optArrayValue) {
                    $optionPieces[] = '--'.$opt.'="'.addslashes($optArrayValue).'"';
                }
            } else {
                $option = null;

                //option exists with no value
                if (is_numeric($opt)) {
                    $option = $value;
                } elseif (!empty($value)) {
                    $option = $opt.'="'.addslashes($value).'"';
                }

                if (!is_null($option)) {
                    $optionPieces[] = '--'.$option;
                }
            }
        }

        return implode(' ', $optionPieces);
    }
1085559
private function SaveOptions(array $options)
    {
        $prev = null;
        foreach ($options as $value=>$text)
        {
            $option = new SelectOption();
            $option->SetSelectField($this->select);
            $option->SetPrevious($prev);
            $option->SetText($text);
            $option->SetValue($value);
            $option->Save();
            $prev = $option;
        }
    }
538863
public function initialize(array $options)
    {
        foreach ($options as $optionName => $optionValue) {
            $methodName = 'set' . ucfirst($optionName);
            if (method_exists($this, $methodName)) {
                $this->$methodName($optionValue);
            }
        }
    }
50956
public function setOptions(array $options)
    {
        if ($this->frozen) {
            throw new Exception('The options for the field "'.$this->name.'"');
        }
        $this->options = $options;
        $this->frozen = true;
    }
311087
private function renderExtraRow($beforeRow, $change, $columnsInExtra)
	{
		$data = $this->dataProvider->data[$beforeRow];
		if ($this->extraRowExpression) { //user defined expression, use it!
			$content = $this->evaluateExpression(
				$this->extraRowExpression,
				array('data' => $data, 'row' => $beforeRow, 'values' => $change['columns'])
			);
		} else { //generate value
			$values = array();
			foreach ($columnsInExtra as $c) {
				$values[] = $change['columns'][$c]['value'];
			}

			$content = '<strong>' . implode(' :: ', $values) . '</strong>';
		}

		$colspan = count($this->columns);

		echo '<tr class="extrarow">';
		$this->extraRowHtmlOptions['colspan'] = $colspan;
		echo CHtml::openTag('td', $this->extraRowHtmlOptions);
		echo $content;
		echo CHtml::closeTag('td');
		echo '</tr>';
	}
1299286
private function printOptionsAndExit() {
		echo "Available Options:\n";
		foreach ($this->validShortOptions as $option => $info) {
			echo "-\033[1m{$option}\033[0m\n	{$info['comment']}\n	{$info['description']}\n		Example: {$info['example']}\n\n";
		}
		foreach ($this->validLongOptions as $option => $info) {
			echo "--\033[1m{$option}\033[0m\n	{$info['comment']}\n	{$info['description']}\n		Example: {$info['example']}\n\n";
		}
		exit;
	}
1323283
private function validateOptions(array $options, $type)
    {
        if (!isset(self::$requiredOptions[$type])) {
            return;
        }
        foreach (self::$requiredOptions[$type] as $requiredOption) {
            if (!array_key_exists($requiredOption, $options)) {
                throw new ConfigurationException(
                    sprintf('Option "%s" must be provided for "%s" type parameters.', $requiredOption, $type)
                );
            }
        }
    }
825444
public function setExtra($extra)
    {
        $resultData = $this->hydrateIfJsonToArray($extra);
        if (!empty($resultData)) {
            $this->extra = $resultData;
        }
        else {
            $this->extra = [];
        }
    }
509287
function prepOptions(options, defaults) {
  let _options = (options = options || {})

  // Set defaults from options and default
  let ensure = ensureOption(options)
  options = {
    hide: ensure(hide, defaults.autoHide),
    hideJSON: ensure(hideJSON, defaults.autoHideJSON),
    hideObject: ensure(hideObject, defaults.autoHideObject),
    defaultHidden: Object.assign({}, ensure(defaultHidden, defaults.defaultHidden)),
    virtuals: ensure(virtuals, defaults.virtuals),
  }

  // Add to list of default hidden
  if (typeof _options[hidden] === 'object') {
    options[defaultHidden] = Object.assign(options[defaultHidden], _options[hidden])
  }

  if (options[hide] === false) {
    options[hideJSON] = false
    options[hideObject] = false
  }

  return options
}
1072890
public function append($elements, $extra = null)
    {
        $conditions = (array)$elements;

        if (!$this->_where) {
            $this->_where = new Where();
        }

        foreach ($conditions as $condition) {
            $logicInner = 'AND';
            $value      = null;

            if (is_array($condition)) {
                $value      = isset($condition[1]) ? $condition[1] : null;
                $logicInner = isset($condition[2]) ? $condition[2] : 'AND';
                $condition  = $condition[0];
            }

            $this->_where->append(array($condition, $value), $logicInner);
        }
    }
856035
public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $this->assertOptionsAreValid($options);

        foreach ($options['options'] as $i => $option) {
            if (!$option instanceof ProductOptionInterface) {
                throw new InvalidConfigurationException(
                    sprintf('Each object passed as option list must implement "%s"', ProductOptionInterface::class)
                );
            }

            $builder->add((string) $option->getCode(), ProductOptionValueChoiceType::class, [
                'label' => $option->getName() ?: $option->getCode(),
                'option' => $option,
                'property_path' => '[' . $i . ']',
                'block_name' => 'entry',
            ]);
        }
    }
782588
private void appendOption(StringBuilder sb, Option option, boolean required) {
        if (!required) {
            sb.append(OPTIONAL_BRACKET_OPEN);
        }
        if (option.getName() != null) {
            sb.append(OPTION_PREFIX).append(option.getName());
        } else {
            sb.append(LONG_OPTION_PREFIX).append(option.getLongName());
        }
        // if the Option has a value and a non blank arg name
        if (option.hasValue() && (option.getValueName() == null || !option.getValueName().isEmpty())) {
            sb.append(option.isWithEqualSign() ? '=' : LONG_OPTION_SEPARATOR);
            sb.append(ARG_BRACKET_OPEN).append(option.getValueName() != null ? option.getValueName() : getArgName()).append(ARG_BRACKET_CLOSE);
        }
        if (!required) {
            sb.append(OPTIONAL_BRACKET_CLOSE);
        }
    }
959426
private function executeExtraUpdates(array $options)
    {
        foreach ($this->extraUpdates as $oid => $update) {
            list ($document, $changeset) = $update;
            $this->documentChangeSets[$oid] = $changeset;
            $this->getDocumentPersister(get_class($document))->update($document, $options);
        }
    }
964896
public function methodExcludedByOptions($method, array $options)
	{
		return ( ! empty($options['only']) && ! in_array($method, (array) $options['only'])) ||
			( ! empty($options['except']) && in_array($method, (array) $options['except']));
	}
98997
public function addExtra(array $extra = [])
    {
        if (count($this->getExtra()) > 0) {
            $this->extra = array_merge($this->getExtra(), $extra);
        } else {
            $this->extra = $extra;
        }
    }
453267
public void setOptions(String[] options) throws Exception {
    String	tmpStr;

    tmpStr = Utils.getOption("custom-delimiter", options);
    if (tmpStr.length() != 0)
      setCustomDelimiter(tmpStr);
    else
      setCustomDelimiter("");

    tmpStr = Utils.getOption("list", options);
    if (tmpStr.length() != 0)
      setList(tmpStr);
    else
      setList("");

    super.setOptions(options);
  }