public function setValue($value)
{
if ($value === NULL) {
$value = '';
} elseif (!is_scalar($value) && !method_exists($value, '__toString')) {
throw new Nette\InvalidArgumentException(sprintf("Value must be scalar or NULL, %s given in field '%s'.", gettype($value), $this->name));
}
$this->rawValue = $this->value = $value;
return $this;
}