Guest User

Untitled

a guest
Feb 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. function beforeSave ( ) {
  2.    
  3.     if ( !empty ( $this->data['SprayerPotentiel']['email'] ) ||
  4.          !empty ( $this->data['SprayerPotentiel']['coupon_id'] ) ) {
  5.      
  6.       $sprayerPotentiel = $this->__hasAlreadyBeenBoughtBySameUser ( $this->data['SprayerPotentiel']['email'] ,
  7.                                                    $this->data['SprayerPotentiel']['coupon_id']);
  8.     debug ( $sprayerPotentiel ) ;
  9.    
  10.     if ( !empty ( $sprayerPotentiel ) ) {
  11.      
  12.        debug ( 'houhou');
  13.       $this->data['SprayerPotentiel']['count'] = $sprayerPotentiel['count'] + 1 ;
  14.       $this->id          = $sprayerPotentiel['id'] ;
  15.       debug ( $this->id ) ;
  16.     } else {
  17.      
  18.          $this->data['SprayerPotentiel']['count'] = 1 ;
  19.     }
  20.    
  21.    
  22.    
  23.     debug ( $this->data ) ;
  24.      
  25.      
  26.      
  27.     }
  28.    
  29.    
  30.    
  31.   // die ;
  32.     return true ;
  33.   }
Add Comment
Please, Sign In to add comment