Log message #4223198

# At Username Text
# Jan 21st 2020, 07:36 heke good morning @javier.villanueva
# Jan 21st 2020, 07:36 javier.villanueva morning all
# Jan 21st 2020, 06:51 conehead @walid Maybe have a look at this. https://discourse.cakephp.org/t/cake-dm-a-domain-driven-design-approach-to-cakephp/6975 https://github.com/pabloelcolombiano/cake-dm I did not try it, but looks like something you could use. Personally I am using plugins
# Jan 21st 2020, 06:41 conehead But I would strongly advise not to edit "app/vendor/cakephp/authentication/src/Identifier/Resolver/OrmResolver.php" Create your own file and use the same code you are using right now. This way your changes will not be lost when cakephp has an update. additionally this way it should not be recognized by git
# 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