Log message #4179867

# At Username Text
# Mar 15th, 13:07 cakephp-slack CakePHP 3.7 btw
# Mar 15th, 13:06 cakephp-slack When I’m using multiple scopes in my routing, is there a way of knowing which scope I’m in, in the controller?
# Mar 15th, 12:35 berarma @half2me, I meant to use formatResults to load the comments not to filter them.
# Mar 15th, 11:42 edgaras.jan add `group(Comments.article_id)` instead of `limit(1)`
# Mar 15th, 11:10 half2me You definitely want to use SQL to sort out the data not PHP :S
# Mar 15th, 11:10 half2me I'm tinking hundreds of thousands of comments...
# Mar 15th, 11:09 half2me @berarma but that loads the entire dataset into memory
# Mar 15th, 11:09 berarma You could use Query::formatResults
# Mar 15th, 10:55 half2me what is the recommended way to get such an association working? It would be really useful to have this in an association.
# Mar 15th, 10:55 half2me if I get rid of that `LIMIT 1` it works, but I now get multiple authors returned, and I would have to call a `DISTINCT` as well...
# Mar 15th, 10:54 half2me But if I want to do a `get($authorId, ['contain' => ['Articles.LatestComment']])` the generated SQL query only returns 1 latest comment because it applies that `limit 1`
# Mar 15th, 10:53 half2me the problem with that is it works for a single Article
# Mar 15th, 10:53 half2me but because the `join` strategy doesn't work with these, I used the `select` strategy
# Mar 15th, 10:53 half2me the finder did a `$query->orderAsc('posted_date')->limit(1);`
# Mar 15th, 10:52 half2me what I tried doing is making a `latestComment` association, where I specified a custom `finder`
# Mar 15th, 10:51 half2me I want to make a hasOne association on Articles, which always returns the last comment posted for that article
# Mar 15th, 10:51 half2me Suppose you have Authors, Articles, Comments (comments have a posted date)
# Mar 15th, 10:50 half2me @berarma back to my previous question, I'll explain the scenario I have, which could be a pretty common use case, but I'm unsure of the best way to implement it
# Mar 15th, 10:39 dereuromark mixing input from URL params as arguments with this seems like a really bad idea.
# Mar 15th, 10:39 dereuromark I dont like how controller actions are injected here, I would expect only the controller to have the service as attribute.
# Mar 15th, 10:36 dakota if it was done at a cakefest
# Mar 15th, 10:36 dakota vaguely. It should be on the youtube channel
# Mar 15th, 10:36 dakota For users, there is http://github.com/cakedc/users, for mail just use a service like mailgun and for invoicing integrate into something like freshbooks :slightly_smiling_face:
# Mar 15th, 10:36 neon1024 Anyone remember the talk that @lorenzo did about implementing a DI container? I’m certain he used https://github.com/lorenzo/piping-bag
# Mar 15th, 10:34 dakota because buying random scripts always works so well :,)
# Mar 15th, 10:25 acosonic They say it's same thing for them switching from cake 2 -> Cake 3, or cake 2 -> Laravel, I have 2 seniors and 1 medior, medior does not care, but seniors want to give Laravel a try, since they were "testing" cake 3 yesterday and decided to migrate cake 2 code, now they want to just buy laravel scripts and try to merge them into 1 system...
# Mar 15th, 10:23 half2me @acosonic is that the only reason why they want to switch to Laravel?
# Mar 15th, 10:21 narendravaghela @acosonic Same happened with me, my past agency started to adopt Laravel and I left the agency :)
# Mar 15th, 10:18 acosonic I say it's just good marketing, we will regret it when it comes to some advanced debugging... https://codecanyon.net/item/classic-invoicer/6193251 and https://codecanyon.net/item/acelle-email-marketing-web-application/17796082 also https://codecanyon.net/item/vanguard-advanced-php-login-and-user-management/14521866 perhaps there are cake 3 clones of that?
# Mar 15th, 10:16 acosonic I know, but they are now purchasing some 3 stuff from codecanyon to test it, they say they will pay from their own pocket... I can share what exactly are they purchasing, if you care...
# Mar 15th, 10:10 dakota But Cake is so much better :slightly_smiling_face:
# Mar 15th, 10:03 acosonic Now my team wants to ditch cake 3 and go to Laravel :( they say they don't think that learning curve is too much different, and they insist on Laravel
# Mar 15th, 09:53 half2me that explains a lot, thanks @berarma
# Mar 15th, 09:52 berarma Have you read https://book.cakephp.org/3.0/en/orm/associations.html#default-association-conditions ?
# Mar 15th, 09:52 half2me but I think it might be the same for hasMany as well
# Mar 15th, 09:52 half2me hasOne
# Mar 15th, 09:52 berarma @half2me, which association type?
# Mar 15th, 09:52 dereuromark ping @lorenzo
# Mar 15th, 09:52 half2me or anyone :slightly_smiling_face:
# Mar 15th, 09:51 dereuromark I am not the god of ORM :slightly_smiling_face: dunno
# Mar 15th, 09:51 half2me @dereuromark?