/** * unlink the record * * @param Record $record * @return bool */ public function unlinkRecord(Record $record) { $key = $this->search($record); if ($key === false) { return false; } $this->offsetUnset($key); if ($this->refRecord && $this->relation) { $this->relation->updateRecordReference($record, null); } return true; }