how do I delete a record ? #40

Closed
zivhsiao opened this Issue Jun 14, 2012 · 1 comment

Projects

None yet

3 participants

@zivhsiao

I tried to delete some record but failed.

my code below:

$query = new \morph\Query();
$query->property('title')->equals('test');

$rs = $scraped->findByQuery($query);
$scraped->deleteByQuery($query);

something wrong ? please tell me the right way, thanks!

@kkamkou
Contributor
kkamkou commented Jul 4, 2012
echo 'total: ' . $rs->totalCount();
foreach ($rs as $record) {
    $record->delete();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment