Skip to content

Commit

Permalink
feature: add updateFundId method
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubersilva committed Dec 13, 2023
1 parent 6020434 commit 454371f
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/Revenue/Repositories/Revenue.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Give\Donations\Models\Donation;
use Give\Framework\Database\DB;
use Give\Framework\Exceptions\Primitives\InvalidArgumentException;
use Give\Framework\Support\ValueObjects\Money;

/**
* Class Revenue
Expand Down Expand Up @@ -66,6 +65,24 @@ public function deleteByDonationId($revenueId)
);
}

/**
* @unreleased
*
* @return false|int
*/
public function updateFundId(int $fundId, Donation $donation)
{
global $wpdb;

return DB::update(
$wpdb->give_revenue,
['fund_id' => $fundId],
['donation_id' => $donation->id],
['%d'],
['%d']
);
}

/**
* @since 2.22.1
*
Expand Down

0 comments on commit 454371f

Please sign in to comment.