protected function _preserveFilename(EntityInterface $entity, array $options = []) {
		$filename = $entity['filename'];
		if (!empty($options['filePrefix'])) {
			$filename = $options['filePrefix'] . $entity['filename'];
		}
		if (!empty($options['fileSuffix'])) {
			$split = $this->splitFilename($filename, true);
			$filename = $split['filename'] . $options['fileSuffix'];
			if ($options['preserveExtension'] === true) {
				$filename .= $split['extension'];
			}
		}

		return $filename;
	}
protected function _preserveFilename(EntityInterface $entity, array $options = []) {
		$filename = $entity['filename'];
		if (!empty($options['filePrefix'])) {
			$filename = $options['filePrefix'] . $entity['filename'];
		}
		if (!empty($options['fileSuffix'])) {
			$split = $this->splitFilename($filename, true);
			$filename = $split['filename'] . $options['fileSuffix'];
			if ($options['preserveExtension'] === true) {
				$filename .= $split['extension'];
			}
		}

		return $filename;
	}
protected function _preserveFilename ( EntityInterface $ entity , array $ options = [ ] ) { $ filename = $ entity [ 'filename' ] ; if ( ! empty ( $ options [ 'filePrefix' ] ) ) { $ filename = $ options [ 'filePrefix' ] . $ entity [ 'filename' ] ; } if ( ! empty ( $ options [ 'fileSuffix' ] ) ) { $ split = $ this -> splitFilename ( $ filename , true ) ; $ filename = $ split [ 'filename' ] . $ options [ 'fileSuffix' ] ; if ( $ options [ 'preserveExtension' ] === true ) { $ filename .= $ split [ 'extension' ] ; } } return $ filename ; }
Keeps the original filename but is able to inject pre- and suffix.

This can be useful to create versions of files for example.

@param \Cake\Datasource\EntityInterface $entity
@param array $options
@return string
Keeps the original filename but is able to inject pre - and suffix .