English (United Kingdom)
Knowledge Base  >  Vik Appointments  >  Hooks  >  Appointments  >  After Save (Late)

apply_filters( 'vikappointments_after_save_reservation_late', bool $status, array $data, bool $isNew, JModel $model )

Fires once all the details of the appointment has been saved.


Description

This hook is triggered after creating or updating an appointment record.

Use this hook in place of vikappointments_after_save_reservation in case you wish to immediately access the saved extra data of the reservation, such as the options, the user notes and so on.


Parameters

$status

(bool)  True on success, false otherwise.

$data

(array)  The properties of the appointment that have been saved.

$isNew

(bool)  True in case the appointment has been created, false in case an existing appointment was updated.

$model

(JModel)  The model instance that handles the saving process.


Example

/**
 * Trigger hook to allow the plugins to make something after
 * saving an appointment.
 *
 * @param  boolean  $status  True on success, false otherwise.
 * @param  mixed    $data    The saved record.
 * @param  boolean  $isNew   True if new, false in case of update.
 * @param  JModel   $model   The model instance.
 */
add_filter('vikappointments_after_save_reservation_late', function($status, $data, $isNew, $model)
{
    // it is now possible to access the appointment details
    $order = VAPOrderFactory::getAppointments($data['id']);

    /**
     * @todo do something after saving an appointment
     */

    return $status;
}, 10, 4);

Changelog

Version Description
1.2 Introduced.
Last Update: 2021-10-04
Helpful?
See Also:

This website uses cookies

This website uses cookies and similar technologies. Some of these technologies are necessary for the proper functioning of the website (Essential). Other technologies are used to evaluate user behavior (Analysis), to integrate external media or for advertising purposes. If you agree, these technologies are activated. For details, please refer to the privacy policy. From this same page you can also update/revoke your consent. If you do not give your consent, only cookies with essential functions will be activated.

We use technologies from the USA on our website. If you give your consent, you therefore consent at the same time to your data being transferred to the USA. We would like to point out that the USA does not have a level of data protection comparable to that of the EU and that any US company can be obliged by state authorities to hand over your data without you having any effective legal protection against this.