# |
Mar 14th 2018, 12:07 |
narendravaghela |
@lorenzo thanks |
# |
Mar 14th 2018, 12:06 |
lorenzo |
that’s how you join a subquery on the same contained table…. or whatever table |
# |
Mar 14th 2018, 12:05 |
lorenzo |
@narendravaghela `$usersTable->find()->contain('Things')->innerJoin(['c1' => $commentsTable->find()->where(…)])->where(…)` |
# |
Mar 14th 2018, 12:04 |
xinobi |
lorenzo exactly |
# |
Mar 14th 2018, 12:03 |
lorenzo |
password hashers use a lot of cpu |
# |
Mar 14th 2018, 12:02 |
xinobi |
I seriously don't understand why it should be spent cpu processing time with $hasher = $this->passwordHasher(); within _findUser method comments say: //helps mitigate timing attacks that are attempting to find valid usernames. Why not using a modeless validator? |
# |
Mar 14th 2018, 12:01 |
ghoritrilochan |
neon 1024 any idea for this problem |
# |
Mar 14th 2018, 12:00 |
narendravaghela |
how can I achieve the same query with Cake ORM? |
# |
Mar 14th 2018, 12:00 |
narendravaghela |
https://stackoverflow.com/questions/28158083/mysql-group-and-total-but-return-all-rows-in-each-group?rq=1 |
# |
Mar 14th 2018, 11:59 |
narendravaghela |
right, and for that I need subquery |
# |
Mar 14th 2018, 11:58 |
neon1024 |
Group will always reduce the size of the result set |
# |
Mar 14th 2018, 11:58 |
neon1024 |
If I understand, that’s not possible. |
# |
Mar 14th 2018, 11:58 |
narendravaghela |
let me try contain |
# |
Mar 14th 2018, 11:58 |
narendravaghela |
and also want all the rows. |
# |
Mar 14th 2018, 11:58 |
narendravaghela |
I want to fetch all all entries from a table with group by |
# |
Mar 14th 2018, 11:57 |
ghoritrilochan |
shreehariji.com |
# |
Mar 14th 2018, 11:57 |
neon1024 |
You can contain the same table as long as it’s alias is unique |
# |
Mar 14th 2018, 11:57 |
ghoritrilochan |
https://b4umusic.000webhostapp.com/shreehariji/ |
# |
Mar 14th 2018, 11:57 |
ghoritrilochan |
hii.. my project live in two different server but one proper work and other in not work plz help.. |
# |
Mar 14th 2018, 11:57 |
narendravaghela |
contain the same table? |
# |
Mar 14th 2018, 11:57 |
neon1024 |
Perhaps you’re looking for `contain()` ? |
# |
Mar 14th 2018, 11:56 |
neon1024 |
You can’t, all it does is join tables |
# |
Mar 14th 2018, 11:55 |
narendravaghela |
how can I pass fields in `join` method? |
# |
Mar 14th 2018, 11:38 |
narendravaghela |
The goal is - find all time log entries with date wise sum |
# |
Mar 14th 2018, 11:37 |
narendravaghela |
Got it, I need to prepare array in `join` method |
# |
Mar 14th 2018, 11:36 |
narendravaghela |
So, I tried join |
# |
Mar 14th 2018, 11:36 |
neon1024 |
https://book.cakephp.org/3.0/en/orm/query-builder.html#subqueries |
# |
Mar 14th 2018, 11:36 |
narendravaghela |
I got a subquery solution form stackoverflow to achieve the goal |
# |
Mar 14th 2018, 11:36 |
neon1024 |
Join is not the method you need |
# |
Mar 14th 2018, 11:36 |
neon1024 |
https://book.cakephp.org/3.0/en/orm/query-builder.html#adding-joins |
# |
Mar 14th 2018, 11:35 |
narendravaghela |
The goal is - find all time log entries with date wise sum |
# |
Mar 14th 2018, 11:34 |
narendravaghela |
I was pasting the code :slightly_smiling_face: |
# |
Mar 14th 2018, 11:34 |
narendravaghela |
https://pastebin.com/LH9L3Z7D |
# |
Mar 14th 2018, 11:34 |
neon1024 |
Are you using `join()` ? |
# |
Mar 14th 2018, 11:33 |
neon1024 |
That’s a bit of a loaded question, as clearly the join you’re using is important for us to see. Especially as you’ve tried passing a Query where an array is needed. So it’s not giving an error, you’ve used it incorrectly. |
# |
Mar 14th 2018, 11:32 |
narendravaghela |
Can we use subquery in joins? It gives an error `Cannot use object of type Cake\ORM\Query as array ` |
# |
Mar 14th 2018, 11:25 |
neon1024 |
Hm, sounds good! Thanks for the info, I’ll have a try |
# |
Mar 14th 2018, 11:24 |
dereuromark |
doesnt miss anything and doesnt seem to have parse issues like regex solutions do |
# |
Mar 14th 2018, 11:23 |
dereuromark |
but I tested it and even though its slow it works good. |
# |
Mar 14th 2018, 11:23 |
dereuromark |
in that case maybe its own yaml would make sense. |
# |
Mar 14th 2018, 11:23 |
dereuromark |
especially since you are only interested in <=3.5 stuff |