/**
  * converts record into raw data for adapter
  *
  * @param  Tinebase_Record_Interface $_record
  * @return array
  */
 protected function _recordToRawData(Tinebase_Record_Interface $_record)
 {
     $_record->runConvertToData();
     $readOnlyFields = $_record->getReadOnlyFields();
     $raw = $_record->toArray(FALSE);
     foreach ($raw as $key => $value) {
         if ($value instanceof Tinebase_Record_Interface) {
             $raw[$key] = $value->getId();
         }
         if (in_array($key, $readOnlyFields)) {
             unset($raw[$key]);
         }
     }
     return $raw;
 }