public function removeImageVersions(EntityInterface $entity, array $versions, array $options = []) {
		$this->_checkImageVersions($entity->model, $versions);

		$result = [];
		foreach ($versions as $version) {
			$hash = $this->getImageVersionHash($entity->model, $version);
			$path = $this->pathBuilder()->fullPath($entity, ['fileSuffix' => '.' . $hash]);
			$result[$version] = [
				'status' => 'success',
				'hash' => $hash,
				'path' => $path
			];
			try {
				$this->getStorageAdapter($entity->adapter)->delete($path);
			} catch (\Exception $e) {
				$result[$version]['status'] = 'error';
				$result[$version]['error'] = $e->getMessage();
			}
		}

		return $result;
	}
public function removeImageVersions(EntityInterface $entity, array $versions, array $options = []) {
		$this->_checkImageVersions($entity->model, $versions);

		$result = [];
		foreach ($versions as $version) {
			$hash = $this->getImageVersionHash($entity->model, $version);
			$path = $this->pathBuilder()->fullPath($entity, ['fileSuffix' => '.' . $hash]);
			$result[$version] = [
				'status' => 'success',
				'hash' => $hash,
				'path' => $path
			];
			try {
				$this->getStorageAdapter($entity->adapter)->delete($path);
			} catch (\Exception $e) {
				$result[$version]['status'] = 'error';
				$result[$version]['error'] = $e->getMessage();
			}
		}

		return $result;
	}
public function removeImageVersions ( EntityInterface $ entity , array $ versions , array $ options = [ ] ) { $ this -> _checkImageVersions ( $ entity -> model , $ versions ) ; $ result = [ ] ; foreach ( $ versions as $ version ) { $ hash = $ this -> getImageVersionHash ( $ entity -> model , $ version ) ; $ path = $ this -> pathBuilder ( ) -> fullPath ( $ entity , [ 'fileSuffix' => '.' . $ hash ] ) ; $ result [ $ version ] = [ 'status' => 'success' , 'hash' => $ hash , 'path' => $ path ] ; try { $ this -> getStorageAdapter ( $ entity -> adapter ) -> delete ( $ path ) ; } catch ( \ Exception $ e ) { $ result [ $ version ] [ 'status' ] = 'error' ; $ result [ $ version ] [ 'error' ] = $ e -> getMessage ( ) ; } } return $ result ; }
Removes image versions of an entity.

@param \Cake\Datasource\EntityInterface $entity
@param array List of image version to remove for that entity.
@param array $options
@param array $options
@return array
Removes image versions of an entity .