In some cases we need to manipulate the data a bit before saving it. So there is a function called PrepareTable() in joomla which is declared under file modeladmin.php and it is located under the libraries/joomla/application/component folder and it is invoked from the function save in that same file. PrepareTable() function is called immediately prior to saving the data to the database. It takes the current form as a parameter and inside this function you can do all the data manipulation that you want.
protected function prepareTable($table)
{
$table->fieldname = newvalue;
}
The above function has to be placed in the model of the form that youre trying to override.
0 Comment(s)