Log message #4052904

# At Username Text
# Jul 17th 2017, 14:49 neon1024 Or use fixtures and mock the database
# Jul 17th 2017, 14:49 neon1024 Or you need to test the generated SQL string, rather than letting it hit the database. As the Cake ORM already has tests
# Jul 17th 2017, 14:48 neon1024 Then it needs refactoring
# Jul 17th 2017, 14:48 ericadeefox @neon1024 it does, but the part of the site I'm testing is to do with lots of `foreach` statements and `if` statements and weird queries
# Jul 17th 2017, 14:46 neon1024 @ericadeefox That seems a strange thing to want to do
# Jul 17th 2017, 14:43 inoas johnwayne union
# Jul 17th 2017, 14:39 ericadeefox ok real quick question: when writing a test, is there a way to check for stuff in the SQL log?
# Jul 17th 2017, 14:19 Martin` hi :)
# Jul 17th 2017, 14:19 Junior yello )
# Jul 17th 2017, 13:45 neothermic Hmm, if I do a saveAll (which with the data I provide will be a saveMany call), and I set atomic to false, will it save all the ones it can and automatically skip over the ones that fail, or will it error on the first failure?
# Jul 17th 2017, 13:38 daniel_san cool, thanks!
# Jul 17th 2017, 13:36 adriencs @hmic thanks
# Jul 17th 2017, 13:30 dereuromark withData() still works afaik :slightly_smiling_face:
# Jul 17th 2017, 13:30 daniel_san How should I set values in a modelless forms in cake 3? https://book.cakephp.org/3.0/en/core-libraries/form.html> suggests to use $this->request-data( but that is marked as deprecated..
# Jul 17th 2017, 13:22 igreat NIce, I will look em up
# Jul 17th 2017, 13:22 dereuromark @igreat Did you hear about https://github.com/FriendsOfCake/awesome-cakephp#imagery yet? Always check the awesome list first :slightly_smiling_face:
# Jul 17th 2017, 13:21 cleptric Or use glide. ADmad wrote cake wrapper: https://github.com/ADmad/cakephp-glide
# Jul 17th 2017, 13:20 cleptric @igreat imagick ^^
# Jul 17th 2017, 13:19 ericadeefox ^^let me get the name of mine, it's a pretty good one.
# Jul 17th 2017, 13:19 igreat Please is there any plugin I can use for image resizing?
# Jul 17th 2017, 13:18 igreat Good day all
# Jul 17th 2017, 13:16 hmic adriencs: if you dont need the associated data but only the count, group and count in the query already!
# Jul 17th 2017, 13:06 adriencs yeah was looking at cakebook API, but it come after the query, load a sh!ton of data
# Jul 17th 2017, 13:05 hmic https://book.cakephp.org/3.0/en/core-libraries/collections.html
# Jul 17th 2017, 13:05 hmic you might want to checkout the Collection class docs - every query result is a collection actually, so you can use all of that goodness...
# Jul 17th 2017, 13:04 adriencs `->countBy` ? Never heard about that :thinking_face:
# Jul 17th 2017, 13:02 hmic adriencs maybe like: $q->find()->contain('OtherTable')->countBy(function($el) { retrun count($el->other_table); });
# Jul 17th 2017, 12:55 adriencs howTo: count results from a contain who's hasMany link ?
# Jul 17th 2017, 12:53 anvyst it should as per code: https://api.cakephp.org/1.3/source-class-View.html#380
# Jul 17th 2017, 12:36 BrainWork hi, in cakephp 1.3 (yes, i know, old version) is it possible to have a / in a call to $this->element() in a view? e.g. <?=$this->element('somedir/elementname')?> ? i ask because we have an awful lot of elements, it's a huge codebase.
# Jul 17th 2017, 12:13 juststeveking Would it be a virtual field, just with the result being an array of items?
# Jul 17th 2017, 12:03 juststeveking I have a Person model, and on that I have a method called collection. What collection does is get the result of a query to "collect" loads of data. I want the Model to load this by default
# Jul 17th 2017, 12:02 juststeveking Anybody able to advise how I can eager load the result of a function with a model?
# Jul 17th 2017, 11:44 johnwayne I have one data set and want to filter data based on given parameter. I am getting right data if I am using orWhere, but if I want to filter data from another table with multiple results then matching filter all data..
# Jul 17th 2017, 11:41 neon1024 Matching is used to filter out data, not include more. Sounds like you want contain
# Jul 17th 2017, 11:39 johnwayne https://pastebin.com/wcV2vyq5
# Jul 17th 2017, 11:39 johnwayne How can I use matching on one table but using matching I want to include results from my where or orWhere on another table?
# Jul 17th 2017, 11:29 inoas $this->setConfig(collection($this->getConfig())->someCalls()->toArray())?
# Jul 17th 2017, 11:29 inoas if it is a config object you could do so but I find it to be horrible design... just set it back and be done with it?
# Jul 17th 2017, 11:23 neon1024 Or could I pass it by reference back into the config instance?
# Jul 17th 2017, 11:23 neon1024 I assume I can assign $this->getConfig() to a variable, re-order it and reset it to $this->setConfig()