public function setUploadedFile($uploadedFile)
{
if (!$this->keep_old_files) {
$this->clear();
}
if ($uploadedFile == STAPLER_NULL) {
$this->clearAttributes();
return;
}
$this->uploadedFile = FileFactory::create($uploadedFile);
$this->instanceWrite('file_name', $this->uploadedFile->getFilename());
$this->instanceWrite('file_size', $this->uploadedFile->getSize());
$this->instanceWrite('content_type', $this->uploadedFile->getMimeType());
$this->instanceWrite('updated_at', new DateTime());
$this->queueAllForWrite();
}