[Deprecated] DMZ 1.6.2 (DataMapper OverZealous Edition) |
[eluser]Jack Scott[/eluser]
Thanks for your quick reply. Adding the extra field to where() fixed the issue I was having. The where() function now looks like: Code: $this->EE->rem4_domain->where("$domain LIKE CONCAT('%', REPLACE(name, '_', '\\_'))", NULL, FALSE); I'm using EE2 Public Beta on this project, so I ran into another unexpected interaction. CI as configured in EE2 uses a database table prefix, so it ends up rewriting the WHERE clause as: Code: WHERE 'www.my.exp_example.com' LIKE I didn't see an easy way around this, so I ended up writing the query manually using the query() method. I never could get order_by() to work for another query. My order_by statement looks like: Code: $ids = array(1, 5, 20, 3, 14, 16); No matter what I did, I couldn't get CI to leave the array of ids alone. I ended up writing a quick and dirty DMZ extension to handle order by field expressions, using some tricks I found in DMZ's source. The order_by statement is now much simpler. It looks like: Code: $this->property->order_by_field('properties.id', $ids); Here's the extension. It works for me, maybe it'll work for you. Code: <?php |
Welcome Guest, Not a member yet? Register Sign In |