public function validate() { if (parent::validate() === false) { return false; } if ($this->isValueEmpty() === true) { return true; } foreach ($this->listeners as $l) { if ($l instanceof FileFieldListener === false) { continue; } /** @var FileFieldListener $l */ if ($this->isValidFileArray($this->value) === true) { if ($this->value[self::VALUE_ERROR] === UPLOAD_ERR_OK) { $l->onUploadSuccess($this->formComponent, $this, $this->value); } else { $l->onUploadFail($this->formComponent, $this, $this->value); } } else { foreach ($this->value as $fileInfo) { if ($fileInfo[self::VALUE_ERROR] === UPLOAD_ERR_OK) { $l->onUploadSuccess($this->formComponent, $this, $fileInfo); } else { $l->onUploadFail($this->formComponent, $this, $fileInfo); } } } } return true; }
public function validate() { if ($this->isValueEmpty() === false) { if ($this->validateDate() === false) { return false; } } return parent::validate(); }