public function setValue($value)
	{
		if ( ! is_string($value) && ! is_int($value))
		{
			throw new \InvalidArgumentException('A RadioGroup value must be a string or int');
		}

		$this->value = $value;

		// Work out which of our children need to be selected
		foreach ($this->getContents() as $item)
		{
			if ($item->getValue() == $value)
			{
				$item->setChecked(true);
			}
			else
			{
				$item->setChecked(false);
			}
		}

		return $this;
	}
public function setValue($value)
	{
		if ( ! is_string($value) && ! is_int($value))
		{
			throw new \InvalidArgumentException('A RadioGroup value must be a string or int');
		}

		$this->value = $value;

		// Work out which of our children need to be selected
		foreach ($this->getContents() as $item)
		{
			if ($item->getValue() == $value)
			{
				$item->setChecked(true);
			}
			else
			{
				$item->setChecked(false);
			}
		}

		return $this;
	}
public function setValue ( $ value ) { if ( ! is_string ( $ value ) && ! is_int ( $ value ) ) { throw new \ InvalidArgumentException ( 'A RadioGroup value must be a string or int' ) ; } $ this -> value = $ value ; // Work out which of our children need to be selected foreach ( $ this -> getContents ( ) as $ item ) { if ( $ item -> getValue ( ) == $ value ) { $ item -> setChecked ( true ) ; } else { $ item -> setChecked ( false ) ; } } return $ this ; }
Sets which radio button is checked

@param  string $value

@return $this

@since 2.0
Sets which radio button is checked