public function set($id, $file)
{
if ($id !== null && in_array($id, $this->availableIds, true)) {
$this->data['id'] = $id;
} else {
$this->data['id'] = null;
}
if ($file !== null) {
$this->storeFile($file->getRealPath());
}
return array_only($this->data, ['id', 'file']);
}