示例#1
0
 public function removeUsers()
 {
     $esus = new Dase_DBO_ExerciseSetUser($this->db);
     $esus->set_id = $this->id;
     foreach ($esus->findAll(1) as $esu) {
         $esu->delete();
     }
 }
示例#2
0
 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}");
 }
示例#3
0
 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;
 }