Newscoop\Services\AttachmentService::getLevel2DirectoryName PHP Méthode

getLevel2DirectoryName() private méthode

Get second level directory name
private getLevel2DirectoryName ( Attachment $attachment ) : string
$attachment Newscoop\Entity\Attachment
Résultat string
    private function getLevel2DirectoryName(Attachment $attachment)
    {
        if ($attachment->getId()) {
            $level2Dir = $attachment->getId() / $this->config['file_num_dirs_level_2'] % $this->config['file_num_dirs_level_1'];
        } else {
            $level2Dir = 0;
        }
        $level2ZeroPad = strlen($this->config['file_num_dirs_level_2']);
        return sprintf('%0' . $level2ZeroPad . 'd', $level2Dir);
    }