public function getSets() { $this->sets = array(); $sets = new Dase_DBO_ExerciseSet($this->db); $sets->creator_eid = $this->eid; $sets->orderBy('title'); foreach ($sets->findAll(1) as $s) { $this->admin_sets[] = $s; } $esus = new Dase_DBO_ExerciseSetUser($this->db); $esus->user_id = $this->id; foreach ($esus->findAll(1) as $esu) { $set = new Dase_DBO_ExerciseSet($this->db); $set->load($esu->set_id); $this->sets[] = $set; } usort($this->sets, array('Util', 'sortObjectsByTitle')); //return $this->sets; }
public static function getAll($db) { $sets = new Dase_DBO_ExerciseSet($db); $sets->orderBy('title'); return $sets->findAll(1); }