lox / pheasant

A lightweight data mapper designed to take advantage of PHP 5.3+
http://getpheasant.com
MIT License
101 stars 21 forks source link

Implement delete() on Collection class to support mass-deletion of items #54

Closed bjornpost closed 11 years ago

bjornpost commented 11 years ago

Hi Lachlan,

Since delete() is now implemented in the DomainObject class, it supports deletion of single items. It would be great if a delete method was also available in the Collection class, so we can do things like this:

$postsByAuthor = \Model\Post::findByAuthorId(1);
$postsByAuthor->delete();

For now, we're using a workaround which is ugly: foreach-ing the posts and delete them one-by-one.

lox commented 11 years ago

Implemented in 5a55c551b646f4c569ece79c2dfece208a50b5b8