Log message #4048966

# At Username Text
# Jul 6th 2017, 15:05 eBug this is the resulting SQL: WHERE (transporte_id,asociado_id,operacion_venta_id) IN ('80,68,99', '80,78,96', '80,78,86', '80,78,62')
# Jul 6th 2017, 15:05 eBug inoas: the problem isn't SQL, the problem is that the content of the $request array is quoted by cake when it turns it into a query
# Jul 6th 2017, 15:05 inoas gist your model and finder
# Jul 6th 2017, 15:05 inoas as I said
# Jul 6th 2017, 15:04 juststeveking inoas I have set up all relations on model correctly, and set up everything the way I expect it to, but the container behviour isn't loading it in
# Jul 6th 2017, 15:03 inoas https://gist.github.com/ionas/ec164aa57b8aae3f4d6d0be96ad54af5
# Jul 6th 2017, 15:02 inoas juststevekind gist your table
# Jul 6th 2017, 15:01 inoas then it becomes a simple transporte_id_asociado_id_operacion_venta_id => $list_of_concatted_ids
# Jul 6th 2017, 15:01 inoas https://mariadb.com/kb/en/mariadb/virtual-computed-columns/
# Jul 6th 2017, 15:00 inoas or you can setup an auto increment key
# Jul 6th 2017, 15:00 inoas there are virtual fields in recent mysql/mariadb versions which just read other fields and combine them
# Jul 6th 2017, 15:00 juststeveking For some reason my relation isn't loading :S could it be because the model I am loading is a plugin??
# Jul 6th 2017, 15:00 inoas create a surrogate primary key
# Jul 6th 2017, 14:59 inoas other than that you can hack it in sql
# Jul 6th 2017, 14:59 inoas you can try 'conditions' => ['(transporte_id,asociado_id,operacion_venta_id) IN' => $lista_ids]
# Jul 6th 2017, 14:59 inoas $lista_ids = array(array('foo', 'bar', 'quux'), array(1, 2, 3))?
# Jul 6th 2017, 14:59 eBug inoas and $lista_ids = $this->request->data['RetiradaTransportePendiente'];
# Jul 6th 2017, 14:58 eBug inoas i only use 'conditions' => ['(transporte_id,asociado_id,operacion_venta_id)' => $lista_ids]
# Jul 6th 2017, 14:58 inoas in cakephp2 I would take a look if there is a way to write a subquery and that squbery I would write by hand
# Jul 6th 2017, 14:58 juststeveking Containable behviour isnt behaving for me
# Jul 6th 2017, 14:57 eBug yes
# Jul 6th 2017, 14:57 inoas eBug which conditions? cakephp2?
# Jul 6th 2017, 14:57 eBug #inoas the thing is in $conditions you don't use 'where'
# Jul 6th 2017, 14:29 inoas else you might need a custom expression
# Jul 6th 2017, 14:28 inoas ebug where([fieldA;fieldB;fieldC' => [['foo','bar','quux'], [1,2,3]]]) may work... or may not... give it a try
# Jul 6th 2017, 14:24 chris-andre cakephp-tree is located :slightly_smiling_face:
# Jul 6th 2017, 14:23 admad Check my GH account for tree plugin
# Jul 6th 2017, 14:22 chris-andre Allright, interesting @dereuromark , Thanks :slightly_smiling_face:
# Jul 6th 2017, 14:22 chris-andre @jeremyharris Ill check out recursive function
# Jul 6th 2017, 14:22 dereuromark See http://www.dereuromark.de/2013/02/17/cakephp-and-tree-structures/#treehelper
# Jul 6th 2017, 14:21 admad Just Not in core ;)
# Jul 6th 2017, 14:21 chris-andre Yea, sure, I use the TreeBehavior.
# Jul 6th 2017, 14:21 neon1024 Ah, no, it doesn’t.
# Jul 6th 2017, 14:20 neon1024 I’m pretty certain it has a helper
# Jul 6th 2017, 14:20 neon1024 I’d use the Tree behaviour
# Jul 6th 2017, 14:17 jeremyharris @chris-andre probably a recursive function, unless you know the nesting depth
# Jul 6th 2017, 14:09 chris-andre Hi. I have an resultset/array with tasks which might have children, child might have children and so on (multidimensional). Now I want each task listed in a table with children and childs children etc... Any tips how to "loop" through that data?
# Jul 6th 2017, 14:09 eBug hi, i'm trying to build $conditions for a find so that the resulting sql query would looks something like 'WHERE (colA,colB,colC) in ((a,b,c),(d,e,f),(g,h,i)). My problem ATM is that Cake quotes the elements of the array I'm passing, like '... IN ('a,b,c','d,e,f'','g,h,i')'
# Jul 6th 2017, 14:03 inoas https://gist.github.com/ionas/94e961bf414c78362442041081dad3ca ... @ burzum
# Jul 6th 2017, 14:01 neon1024 Yes
# Jul 6th 2017, 13:56 obinoob Hi, I have a form text field that must be obligatory in case a checkbox is ticked I wonder how can I validate such? I Suppose I need to add some custom rule and return boolean based on checkbox value right?