Log message #4214023

# At Username Text
# Nov 19th 2019, 10:16 neon1024 @kgb.acct.personal Any specific pattern that you’re looking for? Are you looking to sell CakePHP to a manager for a project?
# Nov 19th 2019, 10:15 neon1024 Er, DTO right?
# Nov 19th 2019, 10:15 neon1024 Or use @dereuromark plugin for true data object pattern
# Nov 19th 2019, 10:15 neon1024 Entity pattern for data transfter
# Nov 19th 2019, 10:14 dereuromark Stateless vs stateful :slightly_smiling_face:
# Nov 19th 2019, 10:14 neon1024 Maybe some pattern around email?
# Nov 19th 2019, 10:14 dereuromark But some are necessary
# Nov 19th 2019, 10:14 dereuromark and avoiding singleton where possible :slightly_smiling_face:
# Nov 19th 2019, 10:14 neon1024 Repository pattern
# Nov 19th 2019, 10:13 neon1024 Cake uses Registries quite a bit
# Nov 19th 2019, 10:13 dereuromark some factory pattern is used inside of the locators. some other ones somewhere else. of course.
# Nov 19th 2019, 10:12 kgb.acct.personal so, it really depends on the usage?
# Nov 19th 2019, 10:12 kgb.acct.personal i'm looking for actual use case of patterns
# Nov 19th 2019, 10:12 dereuromark then there is e.g. "bail early" pattern, "prevent exceptions" for workflow and so on and so on
# Nov 19th 2019, 10:11 dereuromark depends on the specific type of class. a normal framework uses quite a few. many even.
# Nov 19th 2019, 10:11 dereuromark why do you ask?
# Nov 19th 2019, 10:11 kgb.acct.personal Something like builder pattern, singleton, etc
# Nov 19th 2019, 10:11 kgb.acct.personal Sorry I don't know the correct term
# Nov 19th 2019, 10:11 dereuromark depends always how you look at it, and at what level
# Nov 19th 2019, 10:10 dereuromark what kind of question is that? can you be more specific in terms of what pattern you mean?
# Nov 19th 2019, 10:09 kgb.acct.personal I mean the internal code
# Nov 19th 2019, 10:09 challgren https://book.cakephp.org/3/en/intro/conventions.html
# Nov 19th 2019, 10:09 pieceof mvc prg ?
# Nov 19th 2019, 10:08 kgb.acct.personal What design pattern does CakePHP use?
# Nov 19th 2019, 10:00 neon1024 You can implement methods in controllers using Crud, and it’ll execute your controller method
# Nov 19th 2019, 09:46 noel Hi all. I'm working with friendsofcake/crud and jsonapi. I have a desire to create an action on a controller, which is intended to do a custom query lookup. I'm struggling to figure out how to implement this within the CRUD ecosystem. Would I have to create a custom CRUD action class and then load that as a component? Or can I just add an action function to my controller (in which case how do I make it work with crud / jsonapi)?
# Nov 19th 2019, 09:43 slackebot !tias
# Nov 19th 2019, 09:43 slackebot Command sent from Slack by challgren:
# Nov 19th 2019, 09:43 dereuromark Try it yourself with some dangerous snippets and see.
# Nov 19th 2019, 09:42 dereuromark Jep
# Nov 19th 2019, 09:41 mehov > if you dont use custom query snippets that means modifying the sql directly, as opposed to using the framework-provided e.g. find or where methods, right?
# Nov 19th 2019, 09:39 dereuromark If u use my tools plugin you have basic trim. That usually suffices if you dont use custom query snippets. In those cases u need more.
# Nov 19th 2019, 09:37 dereuromark No it is just a wrapper. Nothing else.
# Nov 19th 2019, 09:30 mehov Hi everyone, Quick question Does $this->request->getQuery('key') do any filtering/sanitization? And is it safe to put the value directly into $query->where() without any additional sanitization? (As opposed to the good old $_GET where I'm supposed to do all the sanitization myself)
# Nov 19th 2019, 08:40 val I tried `allowEmptyString()`. Doesn't work for `null`
# Nov 19th 2019, 08:39 neon1024 As HTML doesn’t post typed data
# Nov 19th 2019, 08:39 neon1024 I would try `allowEmptyString()` as request data is usually always strings
# Nov 19th 2019, 08:39 val `allowEmpty()` is deprecated :(
# Nov 19th 2019, 08:39 neon1024 Although I’m unsure if `integer()` would allow a `null`
# Nov 19th 2019, 08:38 neon1024 Might need both `allowEmpty` and also `integer()`
# Nov 19th 2019, 08:37 val Yes something like `?int` but there is no `allowEmptyInt`