|
@@ 314-327 (lines=14) @@
|
| 311 |
|
* |
| 312 |
|
* @return bool |
| 313 |
|
*/ |
| 314 |
|
public function increment_stats( $donor_id = 0, $amount = 0.00 ) { |
| 315 |
|
|
| 316 |
|
$donor = new Give_Donor( $donor_id ); |
| 317 |
|
|
| 318 |
|
if ( empty( $donor->id ) ) { |
| 319 |
|
return false; |
| 320 |
|
} |
| 321 |
|
|
| 322 |
|
$increased_count = $donor->increase_purchase_count(); |
| 323 |
|
$increased_value = $donor->increase_value( $amount ); |
| 324 |
|
|
| 325 |
|
return ( $increased_count && $increased_value ) ? true : false; |
| 326 |
|
|
| 327 |
|
} |
| 328 |
|
|
| 329 |
|
/** |
| 330 |
|
* Decrements donor's donation stats. |
|
@@ 340-353 (lines=14) @@
|
| 337 |
|
* |
| 338 |
|
* @return bool |
| 339 |
|
*/ |
| 340 |
|
public function decrement_stats( $donor_id = 0, $amount = 0.00 ) { |
| 341 |
|
|
| 342 |
|
$donor = new Give_Donor( $donor_id ); |
| 343 |
|
|
| 344 |
|
if ( ! $donor ) { |
| 345 |
|
return false; |
| 346 |
|
} |
| 347 |
|
|
| 348 |
|
$decreased_count = $donor->decrease_donation_count(); |
| 349 |
|
$decreased_value = $donor->decrease_value( $amount ); |
| 350 |
|
|
| 351 |
|
return ( $decreased_count && $decreased_value ) ? true : false; |
| 352 |
|
|
| 353 |
|
} |
| 354 |
|
|
| 355 |
|
/** |
| 356 |
|
* Updates the email address of a donor record when the email on a user is updated |