private function getFileName(Attachment $attachment)
{
if ($attachment->getId()) {
$fileName = sprintf('%09d', $attachment->getId());
} else {
$fileName = sprintf('%09d', 0);
}
if ($attachment->getExtension()) {
$fileName .= '.' . $attachment->getExtension();
}
return $fileName;
}