function ResourceUpload::validate in D7 Media 6
1 call to ResourceUpload::validate()
- ResourceUpload::save in resource/
resource.module - Save the current state of a drupal_file in the database. If the file->fid is empty a new database record will be added.
File
- resource/
resource.module, line 344 - Resource API for Drupal, a replacement for files.
Class
Code
function validate($validators = array()) {
if (!isset($this->errors)) {
// Default validation for all uploads.
$validators['file_validate_name_length'] = array();
$this->errors = array();
foreach ($validators as $function => $args) {
array_unshift($args, $file);
$errors = array_merge($errors, call_user_func_array($function, $args));
}
}
return !empty($this->errors);
}