public function unassociate($beans1, $beans2, $fast = NULL)
{
$beans1 = !is_array($beans1) ? array($beans1) : $beans1;
$beans2 = !is_array($beans2) ? array($beans2) : $beans2;
foreach ($beans1 as $bean1) {
foreach ($beans2 as $bean2) {
try {
$this->oodb->store($bean1);
$this->oodb->store($bean2);
$type1 = $bean1->getMeta('type');
$type2 = $bean2->getMeta('type');
$row = $this->writer->queryRecordLink($type1, $type2, $bean1->id, $bean2->id);
$linkType = $this->getTable(array($type1, $type2));
if ($fast) {
$this->writer->deleteRecord($linkType, array('id' => $row['id']));
return;
}
$beans = $this->oodb->convertToBeans($linkType, array($row));
if (count($beans) > 0) {
$bean = reset($beans);
$this->oodb->trash($bean);
}
} catch (SQLException $exception) {
$this->handleException($exception);
}
}
}
}