/**
* Method to set the value of a field. If the field does not exist in the form then the method
* will return false.
*
* @param string $name The name of the field for which to set the value.
* @param string $group The optional dot-separated form group path on which to find the field.
* @param mixed $value The value to set for the field.
*
* @return boolean True on success.
*
* @since 1.7.0
*/
public function setValue($name, $group = null, $value = null)
{
// If the field does not exist return false.
if (!$this->findField($name, $group)) {
return false;
}
// If a group is set use it.
if ($group) {
$this->data->set($group . '.' . $name, $value);
} else {
$this->data->set($name, $value);
}
return true;
}