Using pick column in where

0

Can I use 2 levels of dot notation to filter a PICK column?

I have $monterias->findRecords('t.name',-1,'mancha.coto.id=1')

This raises the error a Unknown column 'mancha.coto.id' in 'where clause' et

I've used the magic tag {@mancha.coto.name} sucessfully elsewhere on the site.

Thanks

asked Jul 14 '11 at 6:03

caroig

16

add comment
enter at least 15 characters

2 Answers

0

Not in findRecords (yet), possibly in Pods 2.1 - you can only use it in the magic_tag or in a $record->get_field('mancha.coto.forever.ever.name')

answered Jul 15 '11 at 12:36

sc0ttkclark

2936

ok, then what would be a got example of the sql to use so that we can get to that second level pick and obtain data from it.. this is very important to my project as well.. stepping through in php to get the information seems a little in-efficient.. I suppose the next best thing would be to setup another pick list from the bottom nested pod to the top most parent so that it is available.. I am not sure about performance with this option either.. – leeburstroghm Jul 18 '11 at 6:26
Try adding additional joins on the relationships. Follow $record->sql to see how Pods is setting up it's own JOINs originally, then add your own to the $params in findRecords. – sc0ttkclark Jul 24 '11 at 9:18
add comment
enter at least 15 characters
0

Ok, that's clear thanks

answered Jul 15 '11 at 7:10

caroig

16

add comment
enter at least 15 characters