src/Utility/FileUpload.php
private function getImagePath(FileStorage $entity, string $version) : string
    {
        $hash = (string)Configure::read(sprintf('FileStorage.imageHashes.file_storage.%s', $version));
        if (empty($hash)) {
            return $entity->get('path');
        }

        $event = new Event('ImageVersion.getVersions', $this, [
            'hash' => $hash,
            'image' => $entity,
            'version' => $version,
            'options' => [],
            'pathType' => 'fullPath'
        ]);

        EventManager::instance()->dispatch($event);

        if (! $event->getResult()) {
            return $entity->get('path');
        }

        return file_exists(WWW_ROOT . trim($event->getResult(), DS)) ?
            $event->getResult() :
            $entity->get('path');
    }
private function getImagePath(FileStorage $entity, string $version) : string
    {
        $hash = (string)Configure::read(sprintf('FileStorage.imageHashes.file_storage.%s', $version));
        if (empty($hash)) {
            return $entity->get('path');
        }

        $event = new Event('ImageVersion.getVersions', $this, [
            'hash' => $hash,
            'image' => $entity,
            'version' => $version,
            'options' => [],
            'pathType' => 'fullPath'
        ]);

        EventManager::instance()->dispatch($event);

        if (! $event->getResult()) {
            return $entity->get('path');
        }

        return file_exists(WWW_ROOT . trim($event->getResult(), DS)) ?
            $event->getResult() :
            $entity->get('path');
    }
private function getImagePath ( FileStorage $ entity , string $ version ) : string { $ hash = ( string ) Configure :: read ( sprintf ( 'FileStorage.imageHashes.file_storage.%s' , $ version ) ) ; if ( empty ( $ hash ) ) { return $ entity -> get ( 'path' ) ; } $ event = new Event ( 'ImageVersion.getVersions' , $ this , [ 'hash' => $ hash , 'image' => $ entity , 'version' => $ version , 'options' => [ ] , 'pathType' => 'fullPath' ] ) ; EventManager :: instance ( ) -> dispatch ( $ event ) ; if ( ! $ event -> getResult ( ) ) { return $ entity -> get ( 'path' ) ; } return file_exists ( WWW_ROOT . trim ( $ event -> getResult ( ) , DS ) ) ? $ event -> getResult ( ) : $ entity -> get ( 'path' ) ; }
Image path getter.

@param \Burzum\FileStorage\Model\Entity\FileStorage $entity FileStorage entity
@param string $version Version name
@return string
Image path getter .