Hi,
i want update a field in account module if an user click on an account. So i write a hook with the action before_retrieve. In the i get the ID from the account, which i want update, with the third argument (see code listing)
So i retrieve my account, because i have only the id and than i want update them. But with the retrieve function i start a never ending loop, beacause my hook is before_retrieve, too.PHP Code:class NiceHook {
function niceFunction(&$focus, $event, $arguments) {
if($_REQUEST['action'] == 'DetailView')
{
require_once('modules/Accounts/Account.php');
$tempAccount = new Account();
$tempAccount->retrieve($arguments->id);
....
$tempAccount->save();
}
}
What is the best practice to update an account before the user see them, without using SQL-statements?


1Likes
LinkBack URL
About LinkBacks



Reply With Quote

Almost available at skype or gtalk at ashdwi1.
Bookmarks