/**
  * Breaks the association between two beans. This method unassociates two beans. If the
  * method succeeds the beans will no longer form an association. In the database
  * this means that the association record will be removed. This method uses the
  * OODB trash() method to remove the association links, thus giving FUSE models the
  * opportunity to hook-in additional business logic. If the $fast parameter is
  * set to boolean TRUE this method will remove the beans without their consent,
  * bypassing FUSE. This can be used to improve performance.
  *
  * @param RedBean_OODBBean $bean1 first bean
  * @param RedBean_OODBBean $bean2 second bean
  * @param boolean          $fast  If TRUE, removes the entries by query without FUSE
  *
  * @return void
  */
 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 (RedBean_Exception_SQL $exception) {
                 $this->handleException($exception);
             }
         }
     }
 }