public function write()
 {
     $date = "";
     if ($this->dateidentified != null) {
         $date = $this->dateidentified->writeAll();
     }
     $id = new OmOccurDeterminations();
     $id->keyvalueset('occid', $this->occid);
     $id->keyvalueset('sciname', $this->scientificname);
     if (strlen($this->infraspecificauthor) > 0) {
         $id->keyvalueset('scientificNameAuthorship', $this->infraspecificauthor);
     } else {
         $id->keyvalueset('scientificNameAuthorship', $this->scientificnameauthorship);
     }
     $code = "";
     if ($this->nomenclaturalcode != null && strlen($this->nomenclaturalcode) > 0) {
         $code = "[" + $this->nomenclaturalcode + "]";
     }
     $id->keyvalueset('identificationRemarks', $this->typestatus + $code);
     $id->keyvalueset('identifiedBy', $this->identifiedby);
     $id->keyvalueset('dateIdentified', $date);
     $id->keyvalueset('identificationQualifier', trim($this->identificationqualifier));
     // TODO: Handle taxonid in authorityfile
     $id->save();
 }
 public function write()
 {
     $date = "";
     if ($this->identificationdate != null) {
         $date = $this->identificationdate->writeAll();
     }
     $id = new OmOccurDeterminations();
     $id->keyvalueset('occid', $this->occid);
     $id->keyvalueset('sciname', $this->getSciName());
     if (strlen($this->infraspecificauthor) > 0) {
         $id->keyvalueset('scientificNameAuthorship', $this->infraspecificauthor);
     } else {
         $id->keyvalueset('scientificNameAuthorship', $this->author);
     }
     $code = "";
     if ($this->plantnamecode != null && strlen($this->plantnamecode) > 0) {
         $code = "[" + $this->plantnamecode + "]";
     }
     $id->keyvalueset('identificationRemarks', $this->typestatus + $code);
     $id->keyvalueset('identifiedBy', $this->identifier);
     $id->keyvalueset('dateIdentified', $date);
     $id->keyvalueset('identificationQualifier', trim($this->genusqualifier . " " . $this->speciesqualifier));
     $id->save();
 }