public function validate(ElggEntity $entity) {

		$shortname = $this->getShortname();
		$validation = new ValidationStatus();

		$value = elgg_extract($shortname, $_FILES, array());
		$error_type = elgg_extract('error', $value);

		$has_uploaded_file = $error_type != UPLOAD_ERR_NO_FILE;
		if (!$has_uploaded_file) {
			if ($this->isRequired() && empty($this->getValues($entity))) {
				$validation->setFail(elgg_echo('prototyper:validate:error:required', array($this->getLabel())));
			}
		} else {
			$error = hypeApps()->uploader->getFriendlyUploadError($error_type);
			if ($error) {
				$validation->setFail($error);
			} else {
				$validation = $this->applyValidationRules($value, $validation, $entity);
			}
		}

		return $validation;
	}
public function validate(ElggEntity $entity) {

		$shortname = $this->getShortname();
		$validation = new ValidationStatus();

		$value = elgg_extract($shortname, $_FILES, array());
		$error_type = elgg_extract('error', $value);

		$has_uploaded_file = $error_type != UPLOAD_ERR_NO_FILE;
		if (!$has_uploaded_file) {
			if ($this->isRequired() && empty($this->getValues($entity))) {
				$validation->setFail(elgg_echo('prototyper:validate:error:required', array($this->getLabel())));
			}
		} else {
			$error = hypeApps()->uploader->getFriendlyUploadError($error_type);
			if ($error) {
				$validation->setFail($error);
			} else {
				$validation = $this->applyValidationRules($value, $validation, $entity);
			}
		}

		return $validation;
	}
{@inheritdoc}