Italian (Italy)

apply_filters_ref_array( 'vikappointments_before_save_employee_settings', bool $save, mixed &$data, JModel $model )

Fires before saving the employee configuration.


Description

This hook is triggered before updating the settings of an employee from the Employees Area in the front-end. It can be used to bind the data that are going to be saved within the database.

TIP: in case of failure while saving the record, it is possible to throw an exception to abort the saving process and return a readable error message. The same can be accomplished by registering an error to the model and returning false.

// throw an exception
throw new Exception('Missing required field', 404);
// or register the error
$model->setError('Missing required field');
return false;

Parameters

$save

(bool)  Use false to abort the saving process.

&$data

(array|object)  Either an array or an object specifying the settings to bind.

$model

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


Example

/**
 * Trigger hook to allow the plugins to bind the object that
 * is going to be saved.
 *
 * @param  boolean  $save   False to abort the saving process.
 * @param  mixed    &$data  The array/object to bind.
 * @param  JModel   $model  The model instance.
 */
add_filter('vikappointments_before_save_employee_settings', function($save, $data, $model)
{
    /**
     * @todo it is possible to inject into $data further settings to save
     */

    return $save;
}, 10, 3);

Changelog

Version Description
1.2.0 Added $save and $model arguments.
1.1.8 Introduced.
Ultimo aggiornamento: 2021-08-12
Utile?
Potrebbe interessarti:

Questo sito web utilizza i cookie

Questo sito web utilizza cookie e tecnologie simili. Alcune di queste tecnologie sono necessarie per il corretto funzionamento del sito web (essenziali). Altre tecnologie sono utilizzate per valutare il comportamento degli utenti (analisi), per integrare media esterni o per scopi pubblicitari. Se l'utente accetta, queste tecnologie vengono attivate. I dettagli sono riportati nella Privacy Policy. Da questa stessa pagina è inoltre possibile aggiornare/revocare il consenso. Se non si fornisce il consenso, verranno attivati solo i cookie con funzioni essenziali.

Sul nostro sito web utilizziamo tecnologie provenienti dagli Stati Uniti. Pertanto, se acconsentite, acconsentite anche al trasferimento dei vostri dati negli Stati Uniti. Desideriamo sottolineare che gli Stati Uniti non hanno un livello di protezione dei dati paragonabile a quello dell'Unione Europea e che qualsiasi azienda statunitense può essere obbligata dalle autorità statali a consegnare i vostri dati senza che voi abbiate alcuno strumento efficace di protezione legale contro questo.