Hey,

well I know that Model::delete(null) could lead to a couple of issues, but since it was the only delete function I found, that was one of the ways I tried it to do the truncate for me.

I think we should have a function called deleteAll (like you suggested) that has $conditions and $cascade as parameter. So depending on how you set those,  the function will either do a simple "truncate"/"delete from" or loop through all items matching the $conditions and then delete them and their related items.

What do you think?



AD7six schrieb:
I am pretty glad that delete/null is NOT tranlated as a truncate
statement - would be pretty easy to do by mistake, and if a user has
access to the delete function, doesn't mean they should be able to wipe
out the table :).

I would guess that in principle it would only need:

	function truncate () // or deleteAll
	{
		$this->query("TRUNCATE TABLE ".$this->table);
	}

to be added the the model defenintion. Of course, that would leave
floating data lying around if there were associations to take care of
and the DB didn't have cascading deletes.

I'll vote for a request on this point,

cheers,

AD7six
ps. How come this message has hijacked the Moo.fx thread?




  

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to