protected function _addCodes( $couponId, array $data )
	{
		$manager = MShop_Factory::createManager( $this->_getContext(), 'coupon/code' );

		foreach( $data as $entry )
		{
			$item = $manager->createItem();
			$item->setCouponId( $couponId );
			$item->setCode( $entry['code'] );
			$item->setCount( $entry['count'] );
			$item->setDateStart( $entry['datestart'] );
			$item->setDateEnd( $entry['dateend'] );

			$manager->saveItem( $item );
		}
	}
protected function _addCodes( $couponId, array $data )
	{
		$manager = MShop_Factory::createManager( $this->_getContext(), 'coupon/code' );

		foreach( $data as $entry )
		{
			$item = $manager->createItem();
			$item->setCouponId( $couponId );
			$item->setCode( $entry['code'] );
			$item->setCount( $entry['count'] );
			$item->setDateStart( $entry['datestart'] );
			$item->setDateEnd( $entry['dateend'] );

			$manager->saveItem( $item );
		}
	}
protected function _addCodes ( $ couponId , array $ data ) { $ manager = MShop_Factory :: createManager ( $ this -> _getContext ( ) , 'coupon/code' ) ; foreach ( $ data as $ entry ) { $ item = $ manager -> createItem ( ) ; $ item -> setCouponId ( $ couponId ) ; $ item -> setCode ( $ entry [ 'code' ] ) ; $ item -> setCount ( $ entry [ 'count' ] ) ; $ item -> setDateStart ( $ entry [ 'datestart' ] ) ; $ item -> setDateEnd ( $ entry [ 'dateend' ] ) ; $ manager -> saveItem ( $ item ) ; } }
Adds the coupon codes to the database.

@param string $couponId
@param array $data
Adds the coupon codes to the database .