Log message #4159326

# At Username Text
# Jul 16th 2018, 13:44 Bigman and the issue is posted 4 years ago ?? maybe cake changed
# Jul 16th 2018, 13:43 Bigman because it isnt work
# Jul 16th 2018, 13:42 neon1024 You’ve asked a question to which you already know the answer?
# Jul 16th 2018, 13:37 Bigman ??
# Jul 16th 2018, 13:37 Bigman it's possible to use " $this->cell('MyCell', ['rootView' => $this]); "
# Jul 16th 2018, 13:37 Bigman into this https://github.com/cakephp/cakephp/issues/5188
# Jul 16th 2018, 13:36 admad you can't. Cell are self contained.
# Jul 16th 2018, 13:35 Bigman i want push a generated inline javascript to scriptBottom from cellview
# Jul 16th 2018, 13:34 Bigman Hi everybody
# Jul 16th 2018, 13:27 neon1024 Yes, a finder is a good idea
# Jul 16th 2018, 13:25 spriz Nice sidestep though @neon1024 :+1:
# Jul 16th 2018, 13:24 spriz throw exception in 2nd finder if the duration field is not there obviously :)
# Jul 16th 2018, 13:24 josbeir $this->Crud->action()->findMethod('withComputedDuration')
# Jul 16th 2018, 13:24 spriz ->find(withComputedDuration)
# Jul 16th 2018, 13:23 josbeir :P
# Jul 16th 2018, 13:23 josbeir findWithComputedFields
# Jul 16th 2018, 13:23 neon1024 I was sure you could put calculated fields “in” somewhere
# Jul 16th 2018, 13:23 neon1024 I should wrap it up somewhere though
# Jul 16th 2018, 13:23 josbeir that works too
# Jul 16th 2018, 13:23 josbeir ;)
# Jul 16th 2018, 13:16 neon1024 File uploaded https://cakesf.slack.com/files/U1BT622HW/FBQK6V9ND/sorting_by_calculated_field.php / https://slack-files.com/T053DPNCM-FBQK6V9ND-bafff4208c - Well, that’s a nice sidestep / hack.
# Jul 16th 2018, 13:11 josbeir :P
# Jul 16th 2018, 13:11 josbeir DateTime::diff()
# Jul 16th 2018, 13:10 neon1024 `TIMEDIFF(finished, began) as duration` kinda easy in MySQL qhich is nice
# Jul 16th 2018, 13:03 josbeir leveraging paginator
# Jul 16th 2018, 13:03 josbeir its probably the most easy solution too
# Jul 16th 2018, 13:03 neon1024 I will try compiling the sort in sql in my controller first though, just to save time
# Jul 16th 2018, 13:03 neon1024 @josbeir Yes, perhaps saving the duration isn’t such a bad idea
# Jul 16th 2018, 12:30 kitcat711 well, I have only the deprecation warning to the "Cake" section now (in debugkit), do I have to handle those too?
# Jul 16th 2018, 12:13 josbeir cant you persist the computed result in your db too ?
# Jul 16th 2018, 12:12 josbeir if we are talking in pagination terms ...
# Jul 16th 2018, 12:12 josbeir thats not going to be easy out of the box :P
# Jul 16th 2018, 12:11 josbeir ah you have a resultset and wat to sort on a 'dynamic' field?
# Jul 16th 2018, 12:11 josbeir sort a collection? what sort of set you want to sort?
# Jul 16th 2018, 11:54 neon1024 I have `began` and `finished` datetimes, but I would like to display in my UI `duration` and sort on it
# Jul 16th 2018, 11:54 neon1024 How can I sort based on a computed field?
# Jul 16th 2018, 10:49 neon1024 “60% of the time, it works every time”
# Jul 16th 2018, 10:48 neon1024 I’d use copy and paste personally.
# Jul 16th 2018, 10:48 dwms to put a 360ph picture with cakephp on the website, how?
# Jul 16th 2018, 09:19 josbeir is_callable($arr, true) seems to do the trick
# Jul 16th 2018, 09:06 josbeir is there a way to detect a callable array notation in php: [ $this, 'myfn' ]