|
@@ 392-401 (lines=10) @@
|
| 389 |
|
$created = false; |
| 390 |
|
|
| 391 |
|
// The DB class 'add' implies an update if the donor being asked to be created already exists |
| 392 |
|
if ( $this->db->add( $data ) ) { |
| 393 |
|
|
| 394 |
|
// We've successfully added/updated the donor, reset the class vars with the new data |
| 395 |
|
$donor = $this->db->get_donor_by( 'email', $args['email'] ); |
| 396 |
|
|
| 397 |
|
// Setup the donor data with the values from DB |
| 398 |
|
$this->setup_donor( $donor ); |
| 399 |
|
|
| 400 |
|
$created = $this->id; |
| 401 |
|
} |
| 402 |
|
|
| 403 |
|
/** |
| 404 |
|
* Fires after creating donors. |
|
@@ 447-453 (lines=7) @@
|
| 444 |
|
|
| 445 |
|
$updated = false; |
| 446 |
|
|
| 447 |
|
if ( $this->db->update( $this->id, $data ) ) { |
| 448 |
|
|
| 449 |
|
$donor = $this->db->get_donor_by( 'id', $this->id ); |
| 450 |
|
|
| 451 |
|
$this->setup_donor( $donor ); |
| 452 |
|
|
| 453 |
|
$updated = true; |
| 454 |
|
} |
| 455 |
|
|
| 456 |
|
/** |