public function getImageVersions(EntityInterface $entity, $options = []) {
		$versionData = $this->_getImageVersionData($entity, $options);
		$versions = [];

		foreach ($versionData as $version => $data) {
			$hash = Configure::read('FileStorage.imageHashes.' . $entity->get('model') . '.' . $version);
			$eventData = [
				'hash' => $hash,
				'image' => $entity,
				'version' => $version,
				'options' => []
			];

			if (method_exists($this, 'dispatchEvent')) {
				$event = $this->dispatchEvent('ImageVersion.getVersions', $eventData);
			} else {
				$event = new Event('ImageVersion.getVersions', $eventData);
				EventManager::instance()->dispatch($event);
			}
			if ($event->isStopped()) {
				$versions[$version] = str_replace('\\', '/', $event->getData('path'));
			}
		}

		return $versions;
	}
public function getImageVersions(EntityInterface $entity, $options = []) {
		$versionData = $this->_getImageVersionData($entity, $options);
		$versions = [];

		foreach ($versionData as $version => $data) {
			$hash = Configure::read('FileStorage.imageHashes.' . $entity->get('model') . '.' . $version);
			$eventData = [
				'hash' => $hash,
				'image' => $entity,
				'version' => $version,
				'options' => []
			];

			if (method_exists($this, 'dispatchEvent')) {
				$event = $this->dispatchEvent('ImageVersion.getVersions', $eventData);
			} else {
				$event = new Event('ImageVersion.getVersions', $eventData);
				EventManager::instance()->dispatch($event);
			}
			if ($event->isStopped()) {
				$versions[$version] = str_replace('\\', '/', $event->getData('path'));
			}
		}

		return $versions;
	}
public function getImageVersions ( EntityInterface $ entity , $ options = [ ] ) { $ versionData = $ this -> _getImageVersionData ( $ entity , $ options ) ; $ versions = [ ] ; foreach ( $ versionData as $ version => $ data ) { $ hash = Configure :: read ( 'FileStorage.imageHashes.' . $ entity -> get ( 'model' ) . '.' . $ version ) ; $ eventData = [ 'hash' => $ hash , 'image' => $ entity , 'version' => $ version , 'options' => [ ] ] ; if ( method_exists ( $ this , 'dispatchEvent' ) ) { $ event = $ this -> dispatchEvent ( 'ImageVersion.getVersions' , $ eventData ) ; } else { $ event = new Event ( 'ImageVersion.getVersions' , $ eventData ) ; EventManager :: instance ( ) -> dispatch ( $ event ) ; } if ( $ event -> isStopped ( ) ) { $ versions [ $ version ] = str_replace ( '\\' , '/' , $ event -> getData ( 'path' ) ) ; } } return $ versions ; }
Gets a list of image versions for a file storage entity.

Use this method to get a list of ALL versions when needed or to cache all the
versions somewhere. This method will return all configured versions for an
image. For example you could store them serialized along with the file data
by adding a "versions" field to the DB table and extend this model.

@param \Cake\Datasource\EntityInterface $entity An ImageStorage database record
@param array $options Options for the version.
@return array A list of versions for this image file. Key is the version, value is the path or URL to that image.
Gets a list of image versions for a file storage entity .