custom update and calling a functon from class. (Logging)

Questionscustom update and calling a functon from class. (Logging)
pascal asked 4 years ago

hi abu,

I have custom pdate function and then after a update I want to log the update, so I have log class and calling the info method. but, I get an error.. when I use firebug in grid. It shows internal error.

The log code is fine. the cbject calling ($log->warn) calling does not work in after_upadte or delete in grid.

function after_update($data)
{
$name=$data["params"]["Product_name"];

if($ans=abcwarehouse($name))

$log->warn("Deleted added inventory:name:$name:,q:$qty1");

}else
{
phpgrid_error("SQL Error");

}

}

Are there any internal logging features?

1 Answers
Abu Ghufran answered 4 years ago

Hi,

You either need to create $log class object again OR
Declare $log as global variable inside function.

Looks to be a variable scope issue.

function after_update($data)
{
global $log;

}

Plus, if you need to log after update … you can also use
on_after_update event. Works same as on_update except that it is fired after the update database query.

Your Answer

14 + 15 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?