public function trash($bean)
{
$this->oodb->signal('delete', $bean);
foreach ($bean as $property => $value) {
if ($value instanceof OODBBean) {
unset($bean->{$property});
}
if (is_array($value)) {
if (strpos($property, 'own') === 0) {
unset($bean->{$property});
} elseif (strpos($property, 'shared') === 0) {
unset($bean->{$property});
}
}
}
try {
$this->writer->deleteRecord($bean->getMeta('type'), array('id' => array($bean->id)), NULL);
} catch (SQLException $exception) {
$this->handleException($exception);
}
$bean->id = 0;
$this->oodb->signal('after_delete', $bean);
}