English (United Kingdom)

apply_filters_ref_array( 'vikappointments_build_employees_list_data', bool $status, array &$employeesJModelVAP $model )

Fires before returning the array of employees.


Description

Trigger hook to manipulate at runtime the response of the query used to load the employees to display, under the Employees List page.

Third party plugins can alter the resulting list of employees.


Parameters

$status

(bool)  True on success, false otherwise.

&$employees

(array)  An array of employees.

$model

(JModelVAP)  The model responsible of loading the data needed to the Employees List page.


Example 

/**
 * Trigger hook to manipulate the query response at runtime. Third party
 * plugins can alter the resulting list of employees.
 *
 * @param  boolean    $status      True on success, false otherwise.
 * @param  array      &$employees  An array of employees.
 * @param  JModelVAP  $model       The view model.
 */
add_filter('vikappointments_build_employees_list_data', function($status, &$employees, $model)
{
    /**
     * @todo do stuff here
     */

    // eg. randomize the ordering of the employees
    shuffle($employees);

    return true;
}, 10, 3);

Changelog

Version Description
1.2 Introduced.
Last Update: 2021-07-30
Helpful?
See Also: