Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function beforeSave ( ) {
- if ( !empty ( $this->data['SprayerPotentiel']['email'] ) ||
- !empty ( $this->data['SprayerPotentiel']['coupon_id'] ) ) {
- $sprayerPotentiel = $this->__hasAlreadyBeenBoughtBySameUser ( $this->data['SprayerPotentiel']['email'] ,
- $this->data['SprayerPotentiel']['coupon_id']);
- debug ( $sprayerPotentiel ) ;
- if ( !empty ( $sprayerPotentiel ) ) {
- debug ( 'houhou');
- $this->data['SprayerPotentiel']['count'] = $sprayerPotentiel['count'] + 1 ;
- $this->id = $sprayerPotentiel['id'] ;
- debug ( $this->id ) ;
- } else {
- $this->data['SprayerPotentiel']['count'] = 1 ;
- }
- debug ( $this->data ) ;
- }
- // die ;
- return true ;
- }
Add Comment
Please, Sign In to add comment