controller/jobs/src/Controller/Jobs/Order/Email/Voucher/Standard.php
protected function addCouponCodes( array $map )
	{
		$couponId = $this->getCouponId();
		$manager = \Aimeos\MShop::create( $this->getContext(), 'coupon/code' );

		foreach( $map as $code => $ref )
		{
			$item = $manager->createItem()->setParentId( $couponId )
				->setCode( $code )->setRef( $ref )->setCount( null ); // unlimited

			$manager->saveItem( $item );
		}
	}
protected function addCouponCodes( array $map )
	{
		$couponId = $this->getCouponId();
		$manager = \Aimeos\MShop::create( $this->getContext(), 'coupon/code' );

		foreach( $map as $code => $ref )
		{
			$item = $manager->createItem()->setParentId( $couponId )
				->setCode( $code )->setRef( $ref )->setCount( null ); // unlimited

			$manager->saveItem( $item );
		}
	}
protected function addCouponCodes ( array $ map ) { $ couponId = $ this -> getCouponId ( ) ; $ manager = \ Aimeos \ MShop :: create ( $ this -> getContext ( ) , 'coupon/code' ) ; foreach ( $ map as $ code => $ ref ) { $ item = $ manager -> createItem ( ) -> setParentId ( $ couponId ) -> setCode ( $ code ) -> setRef ( $ ref ) -> setCount ( null ) ; // unlimited $ manager -> saveItem ( $ item ) ; } }
Saves the given coupon codes

@param array $map Associative list of coupon codes as keys and reference Ids as values
Saves the given coupon codes