public function removeUsers() { $esus = new Dase_DBO_ExerciseSetUser($this->db); $esus->set_id = $this->id; foreach ($esus->findAll(1) as $esu) { $esu->delete(); } }
public function postToSetInstructors($r) { $set = new Dase_DBO_ExerciseSet($this->db); $set->load($r->get('id')); $esu = new Dase_DBO_ExerciseSetUser($this->db); $esu->set_id = $set->id; $esu->user_id = $r->get('instructor_id'); if (!$esu->findOne()) { $esu->insert(); } $r->renderRedirect("admin/set/{$set->id}"); }
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; }