public function getSpeciesByID($id) { $db = DB::instance(); $query = 'SELECT * FROM species WHERE speciesid=?'; $db->query($query, 'i', array($id)); $resultRow = $db->fetchResult(); $this->populate($resultRow); $commonName = new commonname(); $this->commonNames = $commonName->getCommonNameBySpeciesID($this->speciesid); }