protected function _storeFile(Event $event) {
		try {
			$beforeEvent = $this->_beforeStoreFile($event);
			if ($beforeEvent->isStopped()) {
				return $beforeEvent->result;
			}

			$fileField = $this->getConfig('fileField');
			$entity = $event->getData('entity');
			$Storage = $this->getStorageAdapter($entity['adapter']);
			$Storage->write($entity['path'], file_get_contents($entity[$fileField]['tmp_name']), true);

			$event->result = $event->getSubject()->save($entity, [
				'checkRules' => false
			]);

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

			return true;
		} catch (\Exception $e) {
			$this->log($e->getMessage(), LogLevel::ERROR, ['scope' => ['storage']]);
			throw new StorageException($e->getMessage(), $e->getCode(), $e);
		}

		return false;
	}
protected function _storeFile(Event $event) {
		try {
			$beforeEvent = $this->_beforeStoreFile($event);
			if ($beforeEvent->isStopped()) {
				return $beforeEvent->result;
			}

			$fileField = $this->getConfig('fileField');
			$entity = $event->getData('entity');
			$Storage = $this->getStorageAdapter($entity['adapter']);
			$Storage->write($entity['path'], file_get_contents($entity[$fileField]['tmp_name']), true);

			$event->result = $event->getSubject()->save($entity, [
				'checkRules' => false
			]);

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

			return true;
		} catch (\Exception $e) {
			$this->log($e->getMessage(), LogLevel::ERROR, ['scope' => ['storage']]);
			throw new StorageException($e->getMessage(), $e->getCode(), $e);
		}

		return false;
	}
protected function _storeFile ( Event $ event ) { try { $ beforeEvent = $ this -> _beforeStoreFile ( $ event ) ; if ( $ beforeEvent -> isStopped ( ) ) { return $ beforeEvent -> result ; } $ fileField = $ this -> getConfig ( 'fileField' ) ; $ entity = $ event -> getData ( 'entity' ) ; $ Storage = $ this -> getStorageAdapter ( $ entity [ 'adapter' ] ) ; $ Storage -> write ( $ entity [ 'path' ] , file_get_contents ( $ entity [ $ fileField ] [ 'tmp_name' ] ) , true ) ; $ event -> result = $ event -> getSubject ( ) -> save ( $ entity , [ 'checkRules' => false ] ) ; $ this -> _afterStoreFile ( $ event ) ; if ( $ event -> isStopped ( ) ) { return $ event -> result ; } return true ; } catch ( \ Exception $ e ) { $ this -> log ( $ e -> getMessage ( ) , LogLevel :: ERROR , [ 'scope' => [ 'storage' ] ] ) ; throw new StorageException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } return false ; }
Stores the file in the configured storage backend.

@param \Cake\Event\Event $event
@return bool
@throws \Burzum\FileStorage\Storage\StorageException
Stores the file in the configured storage backend .