English (United Kingdom)

apply_filters( 'vikappointments_customer_save', bool $status, array $data, bool $isNew )

Fires after saving a customer.


Description

This hook triggers every time a customer is created or updated through VikAppointments.

NOTE: this hook is available only for backward compatibility and its support may cease in the future. It is suggested to use vikappointments_after_save_customer instead.


Parameters

$status

(bool)  True on success, false otherwise.

$data

(array)  An associative array containing the saved details of the customer. The array might include only the columns that have been explicitly saved.

$isNew

(bool)  True in case a new customer was created, false in case an existing customer was updated.


Example

/**
 * Trigger hook after saving a customer.
 *
 * @param  boolean  $status  True on success, false otherwise.
 * @param  array    $data    The saved data.
 * @param  boolean  $isNew   True in case of INSERT, false in case of UPDATE.
 */
add_filter('vikappointments_after_save_customer', function($status, $data, $isNew)
{
    // load all the details of the customer
    $customer = JModelVAP::getInstance('customer')->getItem($data['id']);

    /**
     * @todo do stuff here
     */

    return $status;
}, 10, 3);

Changelog

Version Description
1.0 Introduced.
Last Update: 2021-08-05
Helpful?