Welcome Guest, Not a member yet? Register   Sign In
Events::on('DBQuery')
#1

Hi 

When the system executes a query I want to parse the query and modify it. I want to create a BeforeExecuteQuery method or event. 

An example: 
The users => ID, Name, Password table 


PHP Code:
$users = new \ App\Models\UserModel(); 
$res 
= $ users->findAll (); 
// select ID, Name, Password from users 


I want the Password field to always be removed from query

For now it's catching the query like this, but I can't change it
Events::on('DBQuery', 'My_parser_query');
Reply


Messages In This Thread
Events::on('DBQuery') - by okatse - 01-14-2021, 12:33 AM
RE: Events::on('DBQuery') - by kleber - 01-19-2021, 03:00 PM
RE: Events::on('DBQuery') - by okatse - 01-20-2021, 09:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB