public function onValidateReservationSearchQuery( array $data, mixed $specialDay ) : void

Fires while validating the table booking request.


Description

Third party plugins can use this hook to perform an extended validation on the table booking search query.
It is possible to throw an exception to safely abort the booking process and present the error message to the guest.

Parameters

$data

(array)  The search query

  • date - the check-in date, formatted according to the configuration of the plugin;
  • hourmin - the check-in time, always in 24H format;
  • people - the number of participants;
  • table - the table that will be assigned to the reservation.
$specialDay

(VRESpecialDay)  The special day instance, if available.

Return Value

None. Rather throw an exception to abort the booking process.


Example

/**
 * Third party plugins can use this hook to perform an extended validation on the seach query.
 * It is possible to throw an exception to abort the booking process.
 * 
 * @param   array  $data        The search query (date, hour, min, people).
 * @param   mixed  $specialDay  The special day instance, if available.
 * 
 * @return  void
 * 
 * @throws  Exception
 */
public function onValidateReservationSearchQuery($data, $specialDay)
{
    /**
     * @todo perform extra checks here...
     */

    throw new Exception('Manually aborted by a custom script.');
}

Changelog

Version Description
1.11 Introduced.
Last Update: 2 days ago.
Helpful?