id = $rec->id; $this->name = $rec->name; $this->timemodified = $rec->timemodified; $this->imageurl = $rec->imageurl; $this->displayorder = $rec->displayorder; } function FetchAll() { $recs = sloodle_get_records('sloodle_currency_types', null, null, 'displayorder asc, name asc'); if (!$recs) { return false; } $currencies = array(); foreach($recs as $rec) { $c = new SloodleCurrency(); $c->loadFromRecord($rec); $currencies[] = $c; } return $currencies; } function FetchIDNameHash() { if (!$currencies = SloodleCurrency::FetchAll()) { return false; } $curbyid = array(); foreach($currencies as $cur) { $id = $cur->id; $name = $cur->name; $curbyid[ $id ] = $name; } return $curbyid; } function ForID($id) { $rec = sloodle_get_record( 'sloodle_currency_types', 'id', $id ); if (!$rec) { return null; } $curr = new SloodleCurrency(); $curr->loadFromRecord( $rec ); return $curr; } } ?>