diff options
Diffstat (limited to 'src/phinde/Subscriptions.php')
| -rw-r--r-- | src/phinde/Subscriptions.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/phinde/Subscriptions.php b/src/phinde/Subscriptions.php index 454d191..403f5d4 100644 --- a/src/phinde/Subscriptions.php +++ b/src/phinde/Subscriptions.php @@ -181,23 +181,37 @@ class Subscriptions } /** - * Mark a subscription as "unsubscribed" + * Begin removal of a a subscription: Set its status to "unsubscribing" * * @param integer $subId Subscription ID * * @return void */ - public function unsubscribed($subId) + public function unsubscribing($subId) { $this->db->prepare( 'UPDATE subscriptions' - . ' SET sub_status = "unsubscribed"' + . ' SET sub_status = "unsubscribing"' . ' , sub_updated = NOW()' . ' WHERE sub_id = :id' )->execute([':id' => $subId]); } /** + * Mark a subscription as "unsubscribed" - delete it + * + * @param integer $subId Subscription ID + * + * @return void + */ + public function unsubscribed($subId) + { + $this->db + ->prepare('DELETE FROM subscriptions WHERE sub_id = :id') + ->execute([':id' => $subId]); + } + + /** * Subscription has been cancelled/denied for some reason * * @param integer $subId Subscription ID |
