/** * @param Link2 $link removes all the beans associated with this link from the relationship * * @return boolean true if all beans were successfully removed or there * were not related beans, false otherwise */ public function removeAll($link) { $focus = $link->getFocus(); $related = $link->getBeans(); $result = true; foreach ($related as $relBean) { if (empty($relBean->id)) { continue; } if ($link->getSide() == REL_LHS) { $sub_result = $this->remove($focus, $relBean); } else { $sub_result = $this->remove($relBean, $focus); } $result = $result && $sub_result; } return $result; }