[Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) |
[eluser]ntheorist[/eluser]
yeah that's true, if you changed your db table without modifying the model file it could still cause probs i guess, but still would provide a bit of self cleanup in many cases. I'm going to try to implement it and see how well it works. Hey also btw, while sql does use '<>' as a NOT operator, it most certainly does allow for '!=' It appears on the bottom of the wiki page (abv External Links), MySql's list of operators and even Codeigniter's own active record docs (point 2 under $this->db->where). I'm only referring to mysql but regardless i'd guess the drivers should work it out. however, there's a few things wrong with Ninja's code He seems to be using a self join for Clients, but he's querying against EVERY individual id in the clients_companies table. where_not_in can and should take an array of data. Also $client->get('id') does nothing, with get() you specify limit, offset, not fields - AR should strip it out but still its misleading. @Ninja, try this perhaps Code: $client = new Client(); Note: i don't know exactly how your tables are setup, but if you ARE using a self join table you may need to use something like $client->select('clients_companies.company_id'). The point is you don't want to waste time getting every column when you just want the id but i think that's what you meant by get('id'); n |
Welcome Guest, Not a member yet? Register Sign In |