public function onStatusChangeReservation(object $data) : void

Fires every time the status of an appointment changes.

It is possible to use the following code to access the details of the changed appointment.

VAPLoader::import('libraries.order.factory');
$order = VAPOrderFactory::getAppointments($data->id_order);

Description

Trigger hook to let the plugins be notified every time the status of the reservations change.


Parameters

$data

(object)  The object holding the details of the new status.

Return Value

None.


Example

/**
 * Trigger event to let the plugins be notified every time the status of the orders change.
 *
 * @param   object   $data    The order status details.
 *
 * @return  void
 */
public function onStatusChangeReservation($data)
{
    // check whether the new status is approved
    $is_approved = JHtml::_('vaphtml.status.isapproved', 'appointments', $data->status);

    if ($is_approved)
    {
        /**
         * @todo do stuff when the status becomes approved
         */
    }
}

Changelog

VersionDescription
1.6.6 Introduced.
Last Update: 2021-11-04 15:02
Helpful?
This site uses cookies. By continuing to browse you accept their use. Further information