Log message #4223194

# At Username Text
# Jan 20th 2020, 22:26 mark.mikkelson oh thanks very much !! ill take a look
# Jan 20th 2020, 22:22 slackebot work like `$query->from(['Alias' => $subquery])->order(['Alias.created'])`
# Jan 20th 2020, 22:22 ndm For that you'd first have to actually create a union query, that is create separate queries and combine them using the queries `union()`/`unionAll()` method https://book.cakephp.org/4/en/orm/query-builder.html#unions You could then either use `epilog()` to append an order clause https://stackoverflow.com/questions/29379579/how-do-you-modify-a-union-query-in-cakephp-3/29386189#29386189 or if prefer use the union query as a subquery, which should
# Jan 20th 2020, 22:14 mark.mikkelson something like that
# Jan 20th 2020, 22:14 mark.mikkelson select * from( select 'Chats' as Deal, id, date from Chats Union Select 'Tasks' as Deal, id, date, from Tasks Union Select 'Calls' as Deal, id, date from Calls ) Order by date
# Jan 20th 2020, 22:05 ndm maybe explain what exactly you're looking for SQL wise
# Jan 20th 2020, 22:04 mark.mikkelson yeah seems to just sort multiple them separatedly so each is sorted by created, just not all combined. I'll just write a function to sort it, was hoping there was some documentation I missed that would cover it :)
# Jan 20th 2020, 21:59 mark.mikkelson I'll give it another bash just incase, thanks.
# Jan 20th 2020, 21:59 mark.mikkelson thanks, although the docs only show sorting each association at a time and not as union from what I tested.
# Jan 20th 2020, 21:57 challgren https://book.cakephp.org/3/en/orm/query-builder.html#sorting-contained-associations
# Jan 20th 2020, 21:55 challgren `$this->Deals->find('all')->contain(['Tasks' => ['order' => 'created'], 'Calls' => ['order' => 'created'], 'Tickets' => ['order' => 'created'], 'Chats' => ['order' => 'created']])->where(['id'=>$id])->first();` would probably work
# Jan 20th 2020, 21:52 mark.mikkelson Hey all, is there a way (cake3.8) to sort by a column across multiple tables. eg. I have something like this: $this->Deals->find('all')->contain(['Tasks', 'Calls', 'Tickets', 'Chats'])->where(['id'=>$id])->first(); Chats, Tickets, Calls and Tasks all have a created(datetime) column. I want to sort the results by created date across all those tables, but can't seem to find any docs on doing this?
# Jan 20th 2020, 20:44 challgren https://book.cakephp.org/authorization/2/en/component.html#skipping-authorization
# Jan 20th 2020, 20:43 luizcmarin I can't find the corresponding $ this-> Auth-> allow for cake 4. would it be $ this-> Authentication -> ....? Would anyone know?
# Jan 20th 2020, 19:47 walid537 Ok thank you for your helping @admad :)
# Jan 20th 2020, 19:39 admad plugin's are the official way to organize your app's MVC into modules
# Jan 20th 2020, 19:39 admad definitely
# Jan 20th 2020, 19:30 walid537 Thank you @admad , this solution it’s reliable for a big application?
# Jan 20th 2020, 19:21 admad https://book.cakephp.org/4/en/plugins.html
# Jan 20th 2020, 19:20 admad @walid537 use plugins
# Jan 20th 2020, 18:41 turkles I'm still not clear what you need to do, or why - is there a problem you are trying to solve by changing the structure?
# Jan 20th 2020, 18:36 walid537 It’s not possible to have a internal structure ?
# Jan 20th 2020, 18:35 turkles You don
# Jan 20th 2020, 18:30 walid537 Just edit mvc structure by modules/module_name/mvc
# Jan 20th 2020, 18:30 walid537 To be able to separate my functionality by module without having 42 controllers files in the /controllers path
# Jan 20th 2020, 18:28 turkles What are you trying to achieve?
# Jan 20th 2020, 18:25 walid537 Hello everyone, I’m wondering if we can easy change MVC structure of CakePHP. Example : MVC Becomes -> modules/module_name/MVC ? Thanks for help.
# Jan 20th 2020, 18:12 ricksaccous that's embarrasing
# Jan 20th 2020, 18:12 ricksaccous now I have it working like a charm
# Jan 20th 2020, 18:08 ricksaccous taht was stupid
# Jan 20th 2020, 18:08 ricksaccous i have no idea why "find" didn't find the file though...
# Jan 20th 2020, 18:07 ricksaccous i have to fix that up
# Jan 20th 2020, 18:07 ricksaccous ```'basePath' => APP . 'data',```
# Jan 20th 2020, 18:07 ricksaccous hahahaha
# Jan 20th 2020, 18:07 ricksaccous instead of projectfolder/data
# Jan 20th 2020, 18:07 ricksaccous it's writing the files to "src/data"
# Jan 20th 2020, 18:07 ricksaccous oh crap lol
# Jan 20th 2020, 18:04 ricksaccous def not an exact match though
# Jan 20th 2020, 18:04 ricksaccous I've copied https://github.com/FriendsOfCake/cakephp-upload/blob/master/src/File/Writer/DefaultWriter.php a good amount, lol
# Jan 20th 2020, 18:02 slackebot <ricksaccous>
# Jan 20th 2020, 17:59 ricksaccous and when i try to do a find / filename ubuntu doesn't find anything