delete a record without get() - using DataMapper |
[eluser]cehennem[/eluser]
Hey there, I wonder why it's not possible to delete a record from a table without necessary of get() them first, in datamapper. So I treid some llike this but it's not working; $members = new Members(); $members->where('id', 150)->delete(); // supposed to delete member with id=150 Is there any way to simply delete a record from the table, without selecting it first? If not, I'm going to have to write my own delete function which may look silly ![]()
[eluser]PravinS[/eluser]
http://ellislab.com/codeigniter/user-gui...tml#delete
[eluser]WanWizard[/eluser]
Datamapper is an ORM, not a query builder or generator. You can't delete what you don't have, so you need to get it first. If you don't want that, @pbs has pointed you to the alternative (what works how you want to). |
Welcome Guest, Not a member yet? Register Sign In |