From 5b38a49da26659310a2e06e100c594bcbadb7d21 Mon Sep 17 00:00:00 2001 From: Divya Chaudhari Date: Wed, 26 May 2021 19:26:14 +0530 Subject: [PATCH] Task #171108 chore: Trigger changes --- src/com_tjvendors/admin/models/payout.php | 4 ++++ src/plugins/tjvendors/tjvendors/tjvendors.php | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/com_tjvendors/admin/models/payout.php b/src/com_tjvendors/admin/models/payout.php index 25003c17..f87396d2 100644 --- a/src/com_tjvendors/admin/models/payout.php +++ b/src/com_tjvendors/admin/models/payout.php @@ -347,6 +347,10 @@ public function changePayoutStatus($payout_id, $paidUnpaid) { // Update their details in the users table using id as the primary key. $result = Factory::getDbo()->updateObject('#__tjvendors_passbook', $object, 'id'); + // Plugin trigger + PluginHelper::importPlugin('tjvendors'); + $dispatcher = JDispatcher::getInstance(); + $dispatcher->trigger('tjVendorOnPayoutStatusChange', $object); return true; } diff --git a/src/plugins/tjvendors/tjvendors/tjvendors.php b/src/plugins/tjvendors/tjvendors/tjvendors.php index e6242c45..81f5dfdf 100644 --- a/src/plugins/tjvendors/tjvendors/tjvendors.php +++ b/src/plugins/tjvendors/tjvendors/tjvendors.php @@ -57,4 +57,19 @@ public function tjVendorOnAfterVendorSave($data) public function tjVendorOnAfterPayoutPaid($id, $data) { } + + /** + * On after payout status is changed + * + * Method is called after payout status is changed. + * + * @param object $object Holds the payout data. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function tjVendorOnPayoutStatusChange($object = null) + { + } }