controller/common/src/Controller/Common/Coupon/Import/Csv/Base.php
protected function getMappedChunk( array &$data, array $mapping )
	{
		$idx = 0;
		$map = [];

		foreach( $mapping as $pos => $key )
		{
			if( isset( $map[$idx][$key] ) ) {
				$idx++;
			}

			if( isset( $data[$pos] ) )
			{
				$map[$idx][$key] = $data[$pos];
				unset( $data[$pos] );
			}
		}

		return $map;
	}
protected function getMappedChunk( array &$data, array $mapping )
	{
		$idx = 0;
		$map = [];

		foreach( $mapping as $pos => $key )
		{
			if( isset( $map[$idx][$key] ) ) {
				$idx++;
			}

			if( isset( $data[$pos] ) )
			{
				$map[$idx][$key] = $data[$pos];
				unset( $data[$pos] );
			}
		}

		return $map;
	}
protected function getMappedChunk ( array & $ data , array $ mapping ) { $ idx = 0 ; $ map = [ ] ; foreach ( $ mapping as $ pos => $ key ) { if ( isset ( $ map [ $ idx ] [ $ key ] ) ) { $ idx ++ ; } if ( isset ( $ data [ $ pos ] ) ) { $ map [ $ idx ] [ $ key ] = $ data [ $ pos ] ; unset ( $ data [ $ pos ] ) ; } } return $ map ; }
Returns the mapped data from the CSV line

@param array $data List of CSV fields with position as key and domain item key as value (mapped data is removed)
@param array $mapping List of domain item keys with the CSV field position as key
@return array List of associative arrays containing the chunked properties
Returns the mapped data from the CSV line