예제 #1
0
 public function getTaxon($taxonID)
 {
     global $db;
     $query = "SELECT * FROM species WHERE Taxon_ID = " . $taxonID;
     $result = $db->getRow($query);
     if (!empty($result)) {
         // Create taxon object.
         $taxon = new Taxon($result["Taxon_ID"]);
         $taxon->setFamily($result["Family"]);
         $taxon->setFamilyAuthor($result["FamilyAuthor"]);
         $taxon->setGenus(trim($result["Genus"]));
         $taxon->setSpecie(trim($result["Species"]));
         $taxon->setSpecieAuthor(trim($result["Species_Author"]));
         $taxon->setSubspecie(trim($result["Subsp"]));
         $taxon->setSubspecieAuthor($result["Subsp_Author"]);
         $taxon->setVariety(trim($result["Var"]));
         $taxon->setVarietyAuthor(trim($result["Var_Author"]));
         $taxon->setForm(trim($result["Form"]));
         $taxon->setFormAuthor(trim($result["Form_Author"]));
         $taxon->setNothosubsp(trim($result["Nothosubsp"]));
         $taxon->setNothosubspAuthor(trim($result["Nothosubsp_Author"]));
         $taxon->setMainCrop(trim($result["Main_Crop"]));
         $taxon->setCommonName(trim($result["Common_Name"]));
         return $taxon;
     }
     return null;
 }