Log message #4170852

# At Username Text
# Oct 8th 2018, 20:08 ricksaccous is different than extract() via collection
# Oct 8th 2018, 20:08 ricksaccous prob should share exactly what you are trying to extract, it's worth mentioning the extract that EntityInterface implements
# Oct 8th 2018, 20:07 ricksaccous @rightscoreanalysis yeah i would think so :slightly_smiling_face:
# Oct 8th 2018, 20:01 rightscoreanalysis I am really stuck on something that really doesn't look to be difficult
# Oct 8th 2018, 20:00 rightscoreanalysis can i extraxt objects with collections?
# Oct 8th 2018, 19:24 ricksaccous oh, neat
# Oct 8th 2018, 19:14 beakman @nk-sonu There's also `->sql()`;
# Oct 8th 2018, 18:57 ricksaccous https://book.cakephp.org/3.0/en/orm/query-builder.html#selecting-rows-from-a-table
# Oct 8th 2018, 18:57 ricksaccous @nk-sonu If you try to call debug() on a Query object, you will see its internal state and the SQL that will be executed in the database:
# Oct 8th 2018, 18:48 nk-sonu because i can see its only giving object.. but i need mysql query like this "SELECT * from `seminars` where (DATE(specific_date) IN ('2018-10-24', '2018-10-25', '2018-10-29')) OR week_day IN (1,4,3,6)"
# Oct 8th 2018, 18:47 nk-sonu is there any way in cakephp 3 to print raw mysql from cakephp query ?
# Oct 8th 2018, 18:46 rightscoreanalysis sure: https://gist.github.com/spacebiscuit/92e6a99cd0cd45174f54b843660e2856
# Oct 8th 2018, 18:44 yuzl use pastebin/gist pls
# Oct 8th 2018, 18:44 rightscoreanalysis I want to extraxt the strat_date and and end_date and put them in an index below the top/main
# Oct 8th 2018, 18:43 slackebot <rightscoreanalysis>
# Oct 8th 2018, 18:43 rightscoreanalysis hi anyone able to help with this: my collection is in this format
# Oct 8th 2018, 18:39 yuzl someone here for help?
# Oct 8th 2018, 18:39 yuzl hi guys. i'm having some troubles saving associated data
# Oct 8th 2018, 18:34 beakman I know, I was building on top of your suggestion of using `IN`.
# Oct 8th 2018, 18:33 edgaras.jan you can't ``` 'OR' => [ 'DATE(specific_date)' => '2018-10-24', 'DATE(specific_date)' => '2018-10-24', ] ```
# Oct 8th 2018, 18:32 edgaras.jan yes, only there is problem when you need same field (array key), then you need use subarray
# Oct 8th 2018, 18:30 beakman I think the `'OR' => [...]` part is what he was looking for.
# Oct 8th 2018, 18:29 beakman ``` 'OR' => [ ['DATE(specific_date) IN ' => '2018-10-24', '2018-10-25], ['DATE(specific_date)' => '2018-10-24'], ['DATE(specific_date)' => '2018-10-24'], 'week_day IN' => [1,4,3,6], ] ```
# Oct 8th 2018, 18:28 edgaras.jan or if you wish first form ``` 'OR' => [ ['DATE(specific_date)' => '2018-10-24'], ['DATE(specific_date)' => '2018-10-24'], ['DATE(specific_date)' => '2018-10-24'], 'week_day IN' => [1,4,3,6], ] ```
# Oct 8th 2018, 18:25 edgaras.jan `SELECT * from `seminars` where (DATE(specific_date) IN ('2018-10-24', '2018-10-25', '2018-10-29')) OR week_day IN (1,4,3,6)`
# Oct 8th 2018, 18:25 nk-sonu in dated we can use IN ? @edgaras.jan
# Oct 8th 2018, 18:25 nk-sonu i am confused in "OR"
# Oct 8th 2018, 18:24 edgaras.jan use `IN`
# Oct 8th 2018, 18:24 slackebot <nk-sonu>
# Oct 8th 2018, 18:21 nk-sonu hi. what to do if i want to search multiple dates compare in OR in mysql with same 1 field ?
# Oct 8th 2018, 18:14 developer Hi Guys. Hope all doing well. I was stuck in cakephp or condition. I want to use multiple OR condition with 3 different dates from same field.
# Oct 8th 2018, 16:46 ricksaccous actually i figured out the replace strat thing
# Oct 8th 2018, 16:42 rrd564 and I want to sort after the grouping
# Oct 8th 2018, 16:42 rrd564 The collection is after a groupBy
# Oct 8th 2018, 16:41 rrd564 Is there a way to sort a collection by the index of its items? Something lige ksort for arrays?
# Oct 8th 2018, 15:07 ricksaccous some of them require looking at matching data on other models
# Oct 8th 2018, 15:07 ricksaccous because i only want deletions in the replace based on certain conditions
# Oct 8th 2018, 15:07 ricksaccous because while i do want some replace-like behavior sometimes on this project there always seems to be some quirk to it
# Oct 8th 2018, 15:06 ricksaccous I'd love for a more robust replace strategy
# Oct 8th 2018, 14:56 ricksaccous in saveStrategy replace, would it be possible to set replace conditions or something?
# Oct 8th 2018, 14:54 ricksaccous ok