Log message #4124067

# At Username Text
# Mar 12th 2018, 12:45 joddit See what I mean about calling ->where() after the map and reduce, but no examples show using any data that is produced by the map/reduce process
# Mar 12th 2018, 12:44 joddit https://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html#stacking-multiple-operations
# Mar 12th 2018, 12:41 joddit Is it out of the question to do a second query?
# Mar 12th 2018, 12:40 joddit Keep in mind "For those cases, the Query object offers the mapReduce() method, which is a way of processing results once they are fetched from the database."
# Mar 12th 2018, 12:39 joddit Depends on how you're using it
# Mar 12th 2018, 12:39 pedroseco even when the field is created on formatresults()?
# Mar 12th 2018, 12:37 joddit You should be able to add ->where() to your query object no problem
# Mar 12th 2018, 12:36 pedroseco On mobile atm, just wanted to have a ideia what would be the best practice on this case
# Mar 12th 2018, 12:33 joddit Maybe paste something on gist so we can take a look
# Mar 12th 2018, 12:31 pedroseco I calculated a value during mapping and I also want to filter my results by that value
# Mar 12th 2018, 12:30 pedroseco yes that is correct
# Mar 12th 2018, 12:25 joddit I guess I'd have to see how you were using it
# Mar 12th 2018, 12:24 joddit So you want to take a value that you calculated during the mapping process and use it in a where clause? O_o
# Mar 12th 2018, 12:22 pedroseco I mean, I already use where() to filter data before, I just need to filter it again by the value I create after.
# Mar 12th 2018, 12:22 pedroseco in this case yes, since I want to filter data from a dynamic field I create on formatResults()
# Mar 12th 2018, 12:20 joddit The where clause is inappropriate to add earlier?
# Mar 12th 2018, 12:17 pedroseco How can i search using ->where() on a query where i manipulated the results by using map/reduce with formatResults() ?
# Mar 12th 2018, 12:17 Martin` hi
# Mar 12th 2018, 12:17 joddit Hi
# Mar 12th 2018, 12:17 pedroseco Hi guys.
# Mar 12th 2018, 12:00 dereuromark Its actually https://github.com/cakephp/migrations/issues/333
# Mar 12th 2018, 11:49 neon1024 @dereuromark I think I might have been thinking of this issue, which is pretty old, https://github.com/cakephp/migrations/pull/321
# Mar 12th 2018, 11:49 joddit I'm sure there's a better way than forcing a rule to pass
# Mar 12th 2018, 11:48 joddit Yeah, what situation is making you do this? What are you trying to accomplish?
# Mar 12th 2018, 11:48 neon1024 Or even just normalize the optional parts out
# Mar 12th 2018, 11:48 neon1024 Or change the process of creating the data to be incremental
# Mar 12th 2018, 11:47 neon1024 If you want to sidestep one, perahps you should consider refactoring your associations
# Mar 12th 2018, 11:47 neon1024 The rules are there to ensure your foreign key validity and stuff like that
# Mar 12th 2018, 11:47 birdy247 _rules is protected
# Mar 12th 2018, 11:47 neon1024 Sure, you can see the edge of the cliff, but you wouldn’t run off it without a good reason
# Mar 12th 2018, 11:47 birdy247 its all about adding
# Mar 12th 2018, 11:46 birdy247 I have had a look at the rules checker
# Mar 12th 2018, 11:46 birdy247 @neon1024 I can see how to remove it though
# Mar 12th 2018, 11:46 neon1024 @dereuromark I believe there is a ticket open for that
# Mar 12th 2018, 11:46 joddit But you want to force pass a rule no?
# Mar 12th 2018, 11:46 neon1024 Although I rules are for data integrity, so if you want to remove one, I’d stop and think why
# Mar 12th 2018, 11:45 dereuromark Is anyone planning to make migrations upgrade to phinx 0.9.*? That would be super awesome
# Mar 12th 2018, 11:45 neon1024 As marshalling is for validating request data
# Mar 12th 2018, 11:45 joddit I think you can whitelist it?
# Mar 12th 2018, 11:45 neon1024 You’ll want to modify it in beforeSave
# Mar 12th 2018, 11:45 birdy247 How can I remove the rule from there?