Set the choices.

@param \qtism\data\content\interactions\SimpleAssociableChoiceCollection $simpleAssociableChoices A collection of at least one SimpleAssociableChoice object.
@throws \InvalidArgumentException If $simpleAssociableChoices is empty.
558824
public function setSimpleAssociableChoices(SimpleAssociableChoiceCollection $simpleAssociableChoices)
    {
        if (count($simpleAssociableChoices) > 0) {
            $this->simpleAssociableChoices = $simpleAssociableChoices;
        } else {
            $msg = "An AssociateInteraction object must be composed of at lease one SimpleAssociableChoice object, none given.";
            throw new InvalidArgumentException($msg);
        }
    }
1133717
protected function setOptions($options)
    {
        if (!$options instanceof OptionsInterface) {
            $options = is_array($options) ? $options : [];
            $options = new Options($options);
        }

        $this->options = $options;
    }
1117822
protected function addNewTagsInChoices(array $choices, array $allChoices, array $values, $isGrouped)
    {
        foreach ($values as $value) {
            if (!\in_array($value, $allChoices)) {
                if ($isGrouped) {
                    $choices['-------'][$value] = $value;
                } else {
                    $choices[$value] = $value;
                }
            }
        }

        return $choices;
    }
1131240
public function setOptions(array $options = []): void
    {
        $this->options = $this->shortcuts = [];
        $this->addOptions($options);
    }
115300
public function setOptions($options)
    {
        if (!is_array($options) && !$options instanceof \Traversable) {
            throw new \InvalidArgumentException(sprintf(
                    'Parameter provided to %s must be an array or Traversable',
                    __METHOD__
            ));
        }
    
        foreach ($options as $key => $value){
            $this->setOption($key, $value);
        }
         
        return $this;
    }
1244226
protected function set_choices() {
		$this->choices['controls'] = [];
		if ( is_array( $this->default ) ) {
			foreach ( $this->default as $key => $value ) {
				$this->choices['controls'][ $key ] = true;
			}
		}
	}
1169199
public function setOptions(array $options) {
        if (!is_array($options)) {
            if (is_object($options) && method_exists($options, 'toArray')) {
                $options = $options->toArray();
            } else {
                throw new \common_exception_Error('Options submitted to '.get_called_class().' must be an array or implement toArray');
            }
        }
        $this->options = $options;
    }
472708
public function setOptions(array $options)
    {
        foreach ($options as $k => $v) {
            $this->setOption($k, $v);
        }
    }
679869
function setOption($option, $value)
    {
        $ret = true;
        if (array_key_exists($option, $this->_options)) {
            $this->_options[$option] = $value;
        } else {
            throw new InvalidArgumentException('Unknown option ' . $option);
        }
    }
69298
public function setRevisions(array $revisions)
    {
        $this->revisions = new ArrayCollection();

        /** @var \Rcm\Entity\Revision $revision */
        foreach ($revisions as $revision) {
            if (!$revision instanceof Revision) {
                throw new InvalidArgumentException(
                    "Invalid Revision passed in.  Unable to set array"
                );
            }

            $this->revisions->set($revision->getRevisionId(), $revision);
        }
    }
1226294
public function removeChoiceCriteria(\Innova\CollecticielBundle\Entity\ChoiceCriteria $choiceCriteria)
    {
        $this->choiceCriterias->removeElement($choiceCriteria);
    }
879874
public function setOptions(array $options)
    {
        foreach ($options as $option => $value) {
            $methodName = 'set'.ucfirst($option);
            if (method_exists($this, $methodName)) {
                $this->$methodName($value);
            }
        }
    }
121699
public function setOptions(array $options = array())
    {
        foreach (static::$supportedOptions as $key) {
            if (isset($options[$key])) {
                $this->$key = $options[$key];
            }
        }
    }
284417
public function setCustomValues($customValues)
    {
        if (!is_array($customValues) && !($customValues instanceof \Traversable)) {
            throw new \InvalidArgumentException('You should pass an array or a collection of key-value pairs');
        }

        $this->customValues = array();

        foreach ($customValues as $element => $value) {
            $this->addCustomValue($element, $value);
        }

        return $this;
    }
1010596
public function setAccessRoles(array $accessRoles)
    {
        foreach ($accessRoles as $role) {
            if (!is_string($role)) {
                throw new \InvalidArgumentException('The role names passed to setAccessRoles() must all be of type string.', 1302172892);
            }
        }
        if ($this->accessRoles !== $accessRoles) {
            $this->accessRoles = $accessRoles;
            $this->addOrUpdate();
        }
    }
1040675
protected function set_choices() {
		if ( ! is_array( $this->choices ) ) {
			$this->choices = [];
		}

		$this->choices = wp_parse_args(
			$this->choices,
			[
				'on'    => esc_html__( 'On', 'kirki' ),
				'off'   => esc_html__( 'Off', 'kirki' ),
				'round' => false,
			]
		);
	}
573130
protected function set_choices() {
		$all_pages = get_pages();
		foreach ( $all_pages as $page ) {
			$this->choices[ $page->ID ] = $page->post_title;
		}
	}