Newscoop\Services\AttachmentService::getFileName PHP Method

getFileName() private method

Get new attachment file name
private getFileName ( Attachment $attachment ) : string
$attachment Newscoop\Entity\Attachment
return string
    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;
    }