public function getMimeType() { if ($this->type === 'jpg') { return 'image/jpeg'; } elseif ($this->type === 'png') { return 'image/png'; } elseif ($this->type === 'bmp') { return 'image/bmp'; } else { throw new \Exception('Invalid image type'); } }