public function onCustomerSave(array $data, bool $isNew) : void

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 onAfterSaveCustomer instead.


Parameters

$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

None.


Example

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

    /**
     * @todo do stuff here
     */
}

Changelog

VersionDescription
1.6 Introduced.
Last Update: 2021-10-06 17:12
Helpful?