admin/jqadm/src/Admin/JQAdm/Coupon/Code/Standard.php
protected function storeFile( \Aimeos\MShop\Coupon\Item\Iface $item, array $files )
	{
		$file = $this->getValue( $files, 'code/file' );

		if( $file == null || $file->getError() === UPLOAD_ERR_NO_FILE ) {
			return;
		}

		$this->checkFileUpload( $file );

		$context = $this->getContext();
		$fs = $context->getFilesystemManager()->get( 'fs-import' );
		$dir = 'couponcode/' . $context->getLocale()->getSite()->getCode();

		if( $fs->isdir( $dir ) === false ) {
			$fs->mkdir( $dir );
		}

		$fs->writes( $dir . '/' . $item->getId() . '.csv', $file->getStream()->detach() );
	}
protected function storeFile( \Aimeos\MShop\Coupon\Item\Iface $item, array $files )
	{
		$file = $this->getValue( $files, 'code/file' );

		if( $file == null || $file->getError() === UPLOAD_ERR_NO_FILE ) {
			return;
		}

		$this->checkFileUpload( $file );

		$context = $this->getContext();
		$fs = $context->getFilesystemManager()->get( 'fs-import' );
		$dir = 'couponcode/' . $context->getLocale()->getSite()->getCode();

		if( $fs->isdir( $dir ) === false ) {
			$fs->mkdir( $dir );
		}

		$fs->writes( $dir . '/' . $item->getId() . '.csv', $file->getStream()->detach() );
	}
protected function storeFile ( \ Aimeos \ MShop \ Coupon \ Item \ Iface $ item , array $ files ) { $ file = $ this -> getValue ( $ files , 'code/file' ) ; if ( $ file == null || $ file -> getError ( ) === UPLOAD_ERR_NO_FILE ) { return ; } $ this -> checkFileUpload ( $ file ) ; $ context = $ this -> getContext ( ) ; $ fs = $ context -> getFilesystemManager ( ) -> get ( 'fs-import' ) ; $ dir = 'couponcode/' . $ context -> getLocale ( ) -> getSite ( ) -> getCode ( ) ; if ( $ fs -> isdir ( $ dir ) === false ) { $ fs -> mkdir ( $ dir ) ; } $ fs -> writes ( $ dir . '/' . $ item -> getId ( ) . '.csv' , $ file -> getStream ( ) -> detach ( ) ) ; }
Stores the uploaded CSV file containing the coupon codes

@param \Aimeos\MShop\Coupon\Item\Iface $item Coupon item object
@param array $files File upload array including the PSR-7 file upload objects
Stores the uploaded CSV file containing the coupon codes