library/QATools/QATools/HtmlElements/Element/Select.php
public function setSelected(array $values)
	{
		$this->assertMultiSelect();

		$candidates = array();
		/* @var $candidates SelectOption[] */

		foreach ( $this->getOptions() as $option ) {
			if ( in_array($option->getValue(), $values) ) {
				$candidates[] = $option;
			}
		}

		return $this->selectOptions($candidates);
	}
public function setSelected(array $values)
	{
		$this->assertMultiSelect();

		$candidates = array();
		/* @var $candidates SelectOption[] */

		foreach ( $this->getOptions() as $option ) {
			if ( in_array($option->getValue(), $values) ) {
				$candidates[] = $option;
			}
		}

		return $this->selectOptions($candidates);
	}
public function setSelected ( array $ values ) { $ this -> assertMultiSelect ( ) ; $ candidates = array ( ) ; /* @var $candidates SelectOption[] */ foreach ( $ this -> getOptions ( ) as $ option ) { if ( in_array ( $ option -> getValue ( ) , $ values ) ) { $ candidates [ ] = $ option ; } } return $ this -> selectOptions ( $ candidates ) ; }
Replaces current selection with given one.

@param array $values Values of options to select.

@return self
Replaces current selection with given one .