Newscoop\Services\AttachmentService::getStorageLocation PHP Method

getStorageLocation() public method

Get attachment storage location
public getStorageLocation ( Attachment $attachment ) : string
$attachment Newscoop\Entity\Attachment
return string
    public function getStorageLocation(Attachment $attachment)
    {
        if ($attachment->getId()) {
            $storageLocation = $this->config['file_directory'] . $this->getLevel1DirectoryName($attachment) . "/" . $this->getLevel2DirectoryName($attachment) . "/" . $this->getFileName($attachment);
        } else {
            $storageLocation = $this->config['file_directory'] . $this->getLevel1DirectoryName($attachment) . "/" . $this->getLevel2DirectoryName($attachment) . "/" . $this->getFileName($attachment);
        }
        return $storageLocation;
    }