Logs for #cakephp

Page 3 of 36,478, showing 100 records out of 3,647,755 total, starting on record 201, ending on 300

# At Username Text
# Jan 23rd, 20:42 k4t I agree, but I think that matching still should return results like ->contain instead of creating weird _matchingData key with associated data
# Jan 23rd, 20:38 ndm When using matching on hasMany or belongsToMany you need to use grouping to avoid duplicates, that's the way to go
# Jan 23rd, 20:38 ndm Matching is really just for filtering based on associated data, not for retrieving associated data. And using separate queries is just how the ORM works.
# Jan 23rd, 20:38 k4t my hair is getting gray becuase of that
# Jan 23rd, 20:37 ndm On a serious note
# Jan 23rd, 20:37 ndm You need to be more open for new experiences :P
# Jan 23rd, 20:36 k4t @ndm do you know what my problem is?
# Jan 23rd, 20:35 k4t group by on DB is not needed
# Jan 23rd, 20:34 challgren Im not sure though try both
# Jan 23rd, 20:33 challgren database,
# Jan 23rd, 20:33 k4t groupBy on database or returned ResultsSet?
# Jan 23rd, 20:32 challgren groupBy()?
# Jan 23rd, 20:31 k4t $results will contain a lot of duplicated items (Posts), and each Post in that array will contain Comment under _matchingData
# Jan 23rd, 20:30 k4t which is a big pain for me
# Jan 23rd, 20:30 k4t so ->matching is fine, it will give me SQL query which I want but result of association collection is not nested in $results array
# Jan 23rd, 20:28 challgren Sorry jumping ahead
# Jan 23rd, 20:28 challgren Ahh ok
# Jan 23rd, 20:28 k4t and these additional queries added by ->contain are completely unnecessary as I already got all required data from db thanks to ->matching
# Jan 23rd, 20:28 challgren You would need to do ->contain([‘Comments’ => function($q) { return $q->where([‘Comments.user_id’ => 2]) }])
# Jan 23rd, 20:27 challgren It contains all the comments
# Jan 23rd, 20:27 k4t but my problem is that results from ->matching are formated different then if I use ->contain
# Jan 23rd, 20:26 challgren True
# Jan 23rd, 20:26 k4t if I add contain it will again generate additional queries
# Jan 23rd, 20:26 challgren Are you missing a contain()?
# Jan 23rd, 20:25 k4t let me explain
# Jan 23rd, 20:25 k4t It will, and it will generally generate query which interests me but my problem is that $results now contain data in "bad" format
# Jan 23rd, 20:25 challgren Ahh theres the ORM expert
# Jan 23rd, 20:25 ndm it will
# Jan 23rd, 20:24 challgren Im not sure on that one
# Jan 23rd, 20:23 k4t let's say we have relation Posts hasMany Comments and I will do: $results = $posts->find()->matching('Comments', function($q) { return $q->where(['Comments.user_id' => 2]) })->toArray(); It will generate 1 SQL query with INNER JOIN, right?
# Jan 23rd, 20:20 challgren Im not an ORM expert by any means but Ill try to help my best
# Jan 23rd, 20:17 k4t you are right but hmm... generally I have a big problem with CakePHP ORM and I can not solve it from years... let me write some details (sec)
# Jan 23rd, 20:15 challgren For example your hasMany is Comments, and you have a Post, with what your talking about you would have 30 duplicate Posts for the 30 comments
# Jan 23rd, 20:14 challgren And not duplicating the original data
# Jan 23rd, 20:14 challgren How would you do it in regular SQL without 2 queries?
# Jan 23rd, 20:14 k4t it will still generate two queries
# Jan 23rd, 20:14 challgren But you can change the strategy https://book.cakephp.org/3/en/orm/associations.html#hasmany-associations
# Jan 23rd, 20:13 challgren How else would you do it without duplicating the original table entries in the results?
# Jan 23rd, 20:05 k4t is it possible to change it?
# Jan 23rd, 20:05 k4t Why CakePHP 3 for hasMany relations generates 2 selects instead of one with JOIN?
# Jan 23rd, 19:19 challgren You could also do a Plugin approach too. It just really depends on what your trying to accomplish specifically
# Jan 23rd, 19:18 mocelle Hm... Good idea. I will try it
# Jan 23rd, 19:18 challgren You could also use Traits
# Jan 23rd, 19:17 challgren Like validators?
# Jan 23rd, 19:17 mocelle Trying to separate BL to own directory
# Jan 23rd, 19:14 challgren I’ve never really seen a use case that would require an extended table except in CakeDC/Users plugin
# Jan 23rd, 19:14 challgren What are you trying to accomplish?
# Jan 23rd, 19:13 mocelle Extended class should be inside Model/Table directory? I became ‚Cannot describe Test It has 0 columns
# Jan 23rd, 19:11 luizcmarin I will keep informed
# Jan 23rd, 19:10 luizcmarin tomorrow I will test this
# Jan 23rd, 19:10 luizcmarin :man-facepalming: thanks @challgren. Amanhã vou testar isso
# Jan 23rd, 19:08 challgren All it means is the code coverage decreased from the previous commit. Nothing to really worry about. If it was continuous-integration that would be a different story.
# Jan 23rd, 19:06 challgren Did you hover over the x to see what failed?
# Jan 23rd, 19:05 luizcmarin I haven't used it yet because of that .... I expected change here
# Jan 23rd, 19:05 luizcmarin @challgren
# Jan 23rd, 19:05 luizcmarin this has nothing to do? Because I think it was wrong. What does that mean?
# Jan 23rd, 19:02 challgren https://github.com/UseMuffin/Sti/releases/tag/2.0.0-beta
# Jan 23rd, 19:01 challgren Sti? Yes we fixed it up for you
# Jan 23rd, 19:01 luizcmarin @challgren is it ok to use in cake 4?
# Jan 23rd, 18:49 challgren https://github.com/UseMuffin/Sti might be useful too
# Jan 23rd, 18:48 challgren MyOtherModel extends CustomerTable
# Jan 23rd, 18:46 mocelle I trying to extend Model Table. For example: I have CustomerTable and I want to extend it. Is there way to extend Model Table?
# Jan 23rd, 18:40 megan @luizcmarin please share with us what you've learnt and what you are up to! (please email me community@cakephp.org - we'd love to hear more and maybe share it with the rest of the community via our channels) :)
# Jan 23rd, 18:39 challgren @ricksaccous you could wrap your task execute in a try catch and then send on failure
# Jan 23rd, 18:38 luizcmarin @ricksaccous well, I already burned a lot of cake, I missed many recipes, but the cake has not disappointed me, on the contrary, I am increasingly enjoying it. Easy to customize, first-rate support, it's great!
# Jan 23rd, 18:35 ricksaccous @luizcmarin lol no problem, hope you are enjoying it
# Jan 23rd, 18:34 luizcmarin @ricksaccous
# Jan 23rd, 18:34 luizcmarin you told me one day to try to get out of my comfort zone and try to do something for ecommerce with cake .... well, i'm learning a lot for doing this. thanks
# Jan 23rd, 18:33 ricksaccous and in your controller it will come back as part of $this->getRequest()->getData() or as part of the patched entity (if it's accessible)
# Jan 23rd, 18:33 ricksaccous $this->Form->control('somecheckbox', ['type' => 'checkbox']);
# Jan 23rd, 18:32 ricksaccous you just create a form control in the edit.php
# Jan 23rd, 18:32 luizcmarin where I should put the public $ removerFoto1 = 0 statement; to be seen in both edit.php and the controller?
# Jan 23rd, 18:32 ricksaccous and look for the data in the controller...
# Jan 23rd, 18:32 ricksaccous you can simply create a form control type checkbox and name it whateve ryou want
# Jan 23rd, 18:30 luizcmarin in fact, I think I put the variable declaration in the wrong place ...
# Jan 23rd, 18:28 luizcmarin Hi, I want to create a variable, type checkbox, there is no need to be a database field. For example, on the edit screen I uploaded an image. If the user wishes, he can check the "Remove image" checkbox on the editing screen so that I can take the necessary action on the controller. What is that called in the cake? Or is there another better alternative?
# Jan 23rd, 18:27 ricksaccous but anyway, as long as i can help someone get something that works
# Jan 23rd, 18:27 ricksaccous or an event
# Jan 23rd, 18:27 ricksaccous would kind of be nice if he had a callback hook that could be implemented on failure though
# Jan 23rd, 18:27 ricksaccous but yeah just scanning it with a cron every x minutes seems like an easy solution
# Jan 23rd, 18:26 ricksaccous unfortunately i can't implement it because i have to work on another project
# Jan 23rd, 18:26 ricksaccous @challgren that's a solution i thought of as well, lol
# Jan 23rd, 18:22 challgren @ricksaccous I have a regular Command that looks at the queue table and when theres 15 failures it emails me non queue
# Jan 23rd, 18:05 ricksaccous has anyone done anything in https://github.com/dereuromark/cakephp-queue like send an email on task failure?
# Jan 23rd, 16:46 neothermic yes
# Jan 23rd, 16:46 admad @neothermic (R) means reserved :)
# Jan 23rd, 16:43 admad `groups`
# Jan 23rd, 16:34 neothermic ahh, it's only an issue if it's got `(R)` in the name in the list
# Jan 23rd, 16:33 jotpe I'll just rename all my table fields to xyz1235
# Jan 23rd, 16:32 neothermic `inactive` ¬_¬
# Jan 23rd, 16:32 neothermic those are going to break a few things
# Jan 23rd, 16:32 neothermic `active`, `admin`
# Jan 23rd, 16:32 neothermic https://dev.mysql.com/doc/refman/8.0/en/keywords.html#keywords-new-in-current-series
# Jan 23rd, 16:32 neothermic wow, they added a bunch in 8
# Jan 23rd, 16:30 jotpe grrrr
# Jan 23rd, 16:29 neothermic `RANK (R); added in 8.0.2 (reserved)`
# Jan 23rd, 16:29 neon1024 @jotpe Oh, nice find :clap:
# Jan 23rd, 16:29 jotpe wtf. Took me ages to solve this: since MySQL 8 `rank()` is a keyword. For that reason, my local dev env does not work @neon1024
# Jan 23rd, 16:28 neothermic aha, but I can pass label as an array, and that'll do it
# Jan 23rd, 16:23 neothermic ah, boo, the bootstrap-ui doesn't support labelOptions :|