|
@@ 421-430 (lines=10) @@
|
| 418 |
|
$created = false; |
| 419 |
|
|
| 420 |
|
// The DB class 'add' implies an update if the donor being asked to be created already exists |
| 421 |
|
if ( $this->db->add( $data ) ) { |
| 422 |
|
|
| 423 |
|
// We've successfully added/updated the donor, reset the class vars with the new data |
| 424 |
|
$donor = $this->db->get_donor_by( 'email', $args['email'] ); |
| 425 |
|
|
| 426 |
|
// Setup the donor data with the values from DB |
| 427 |
|
$this->setup_donor( $donor ); |
| 428 |
|
|
| 429 |
|
$created = $this->id; |
| 430 |
|
} |
| 431 |
|
|
| 432 |
|
/** |
| 433 |
|
* Fires after creating donors. |
|
@@ 476-483 (lines=8) @@
|
| 473 |
|
|
| 474 |
|
$updated = false; |
| 475 |
|
|
| 476 |
|
if ( $this->db->update( $this->id, $data ) ) { |
| 477 |
|
|
| 478 |
|
$donor = $this->db->get_donor_by( 'id', $this->id ); |
| 479 |
|
|
| 480 |
|
$this->setup_donor( $donor ); |
| 481 |
|
|
| 482 |
|
$updated = true; |
| 483 |
|
} |
| 484 |
|
|
| 485 |
|
/** |
| 486 |
|
* Fires after updating donors. |