public function delete()
{
if ($this->triggerEvent('beforeDelete')->isCancelled()) {
return $this;
}
$status = $this->collection->getMongoCollection()->remove(array('_id' => $this->getId()));
if (true !== $status && $status['ok'] != 1) {
throw new \Sokil\Mongo\Exception(sprintf('Delete document error: %s', $status['err']));
}
$this->triggerEvent('afterDelete');
// drop from document's pool
$this->getCollection()->removeDocumentFromDocumentPool($this);
return $this;
}