public function getPath(Event $event) {
		$pathBuilder = $this->pathBuilder();
		$method = $event->getData('method');
		if (!method_exists($pathBuilder, $event->getData('method'))) {
			throw new BadMethodCallException(sprintf('`%s` does not implement the `%s` method!', get_class($pathBuilder), $method));
		};

		$event = $this->dispatchEvent('FileStorage.beforeGetPath', [
			'entity' => $event->getData('entity'),
			'storageAdapter' => $this->getStorageAdapter($event->getData('entity')->get('adapter')),
			'pathBuilder' => $pathBuilder
		]);

		if ($event->isStopped()) {
			return $event->result;
		}

		if ($event->getSubject() instanceof EntityInterface) {
			$event->getData('entity');
		}

		if (empty($event->getData('entity'))) {
			throw new RuntimeException('No entity present!');
		}

		$path = $pathBuilder->{$method}($event->getData('entity'), $event->getData());

		$entity = $event->getData('entity');
		$event = $this->dispatchEvent('FileStorage.afterGetPath', [
			'entity' => $entity,
			'storageAdapter' => $this->getStorageAdapter($entity->get('adapter')),
			'pathBuilder' => $pathBuilder,
			'path' => $path
		]);

		if ($event->isStopped()) {
			return $event->getResult();
		}

		return $path;
	}
public function getPath(Event $event) {
		$pathBuilder = $this->pathBuilder();
		$method = $event->getData('method');
		if (!method_exists($pathBuilder, $event->getData('method'))) {
			throw new BadMethodCallException(sprintf('`%s` does not implement the `%s` method!', get_class($pathBuilder), $method));
		};

		$event = $this->dispatchEvent('FileStorage.beforeGetPath', [
			'entity' => $event->getData('entity'),
			'storageAdapter' => $this->getStorageAdapter($event->getData('entity')->get('adapter')),
			'pathBuilder' => $pathBuilder
		]);

		if ($event->isStopped()) {
			return $event->result;
		}

		if ($event->getSubject() instanceof EntityInterface) {
			$event->getData('entity');
		}

		if (empty($event->getData('entity'))) {
			throw new RuntimeException('No entity present!');
		}

		$path = $pathBuilder->{$method}($event->getData('entity'), $event->getData());

		$entity = $event->getData('entity');
		$event = $this->dispatchEvent('FileStorage.afterGetPath', [
			'entity' => $entity,
			'storageAdapter' => $this->getStorageAdapter($entity->get('adapter')),
			'pathBuilder' => $pathBuilder,
			'path' => $path
		]);

		if ($event->isStopped()) {
			return $event->getResult();
		}

		return $path;
	}
public function getPath ( Event $ event ) { $ pathBuilder = $ this -> pathBuilder ( ) ; $ method = $ event -> getData ( 'method' ) ; if ( ! method_exists ( $ pathBuilder , $ event -> getData ( 'method' ) ) ) { throw new BadMethodCallException ( sprintf ( '`%s` does not implement the `%s` method!' , get_class ( $ pathBuilder ) , $ method ) ) ; } ; $ event = $ this -> dispatchEvent ( 'FileStorage.beforeGetPath' , [ 'entity' => $ event -> getData ( 'entity' ) , 'storageAdapter' => $ this -> getStorageAdapter ( $ event -> getData ( 'entity' ) -> get ( 'adapter' ) ) , 'pathBuilder' => $ pathBuilder ] ) ; if ( $ event -> isStopped ( ) ) { return $ event -> result ; } if ( $ event -> getSubject ( ) instanceof EntityInterface ) { $ event -> getData ( 'entity' ) ; } if ( empty ( $ event -> getData ( 'entity' ) ) ) { throw new RuntimeException ( 'No entity present!' ) ; } $ path = $ pathBuilder -> { $ method } ( $ event -> getData ( 'entity' ) , $ event -> getData ( ) ) ; $ entity = $ event -> getData ( 'entity' ) ; $ event = $ this -> dispatchEvent ( 'FileStorage.afterGetPath' , [ 'entity' => $ entity , 'storageAdapter' => $ this -> getStorageAdapter ( $ entity -> get ( 'adapter' ) ) , 'pathBuilder' => $ pathBuilder , 'path' => $ path ] ) ; if ( $ event -> isStopped ( ) ) { return $ event -> getResult ( ) ; } return $ path ; }
Get the path for a storage entity.

@param \Cake\Event\Event $event
@return string
Get the path for a storage entity .