public function loadHttpData()
{
parent::loadHttpData();
if (!$this->uploadPath) {
throw new \Exception('Path for uploading must be set.');
}
$this->validate();
$this->isValidated = TRUE;
// Disable validation
if ($this->checkbox->isOk()) {
// Checkbox process
$this->checkbox->loadHttpData();
$this->delete = $this->checkbox->getValue();
if ($this->delete && !$this->isRequired()) {
$this->value = NULL;
} else {
if (!$this->isRequired()) {
$this->value = $this->defaultValue;
}
}
} else {
if (!$this->value->isOk()) {
$this->value = NULL;
}
}
if ($this->isRequired() && $this->checkbox->isOk() && !$this->checkbox->getValue()) {
$this->addError($this->getFilledMessage());
return;
}
}