pixie icon indicating copy to clipboard operation
pixie copied to clipboard

Getting the where clause

Open goidx opened this issue 10 years ago • 3 comments

I was wondering if it's possible to get the WHERE clause that makes up the statement from the query? Would like to be able to get what the WHERE clause that was used in the execution of the query.

Try this call but no results: $query->getQuery('criteriaonly');

calling $query->getQuery(); - Returns the entire SQL Query that is to get executed.

any possible way of accomplishing what is required?

goidx avatar Sep 30 '15 01:09 goidx

Sorry $query->getQuery('criteriaonly'); seems buggy. Have to fix but can't give any ETA.

usmanhalalit avatar Oct 03 '15 07:10 usmanhalalit

I need that too. It can be very useful, this way we can reuse a criteria for different tasks such as deleting,selecting or updating. Can't you just speed this one up? I think fixing it would be very simple! I am building a framework on top of pixie and without this feature I can't continue.

creativefctr avatar Oct 15 '15 15:10 creativefctr

I use something like this:

$statements = $query->getStatements(); $wheres = $statements['wheres'];

This gives me an array of the where conditions of the query.

BZinser avatar Oct 20 '15 14:10 BZinser