Esempio n. 1
0
 /**
  * Removes all associations with a track, this entails removing
  * user track, cluster track and class track associations
  * @param none
  * @return none
  */
 function delete()
 {
     // Cascade
     //clean make the delete cascade into association records
     $filter = new field_filter('trackid', $this->id);
     usertrack::delete_records($filter, $this->_db);
     clustertrack::delete_records($filter, $this->_db);
     trackassignment::delete_records($filter, $this->_db);
     parent::delete();
     //Delete this leve's context
     $context = \local_elisprogram\context\track::instance($this->id);
     $context->delete();
 }
Esempio n. 2
0
 function delete()
 {
     if (!empty($this->id)) {
         //clean make the delete cascade into association records
         $filter = new field_filter('classid', $this->id);
         instructor::delete_records($filter, $this->_db);
         student::delete_records($filter, $this->_db);
         trackassignment::delete_records($filter, $this->_db);
         classmoodlecourse::delete_records($filter, $this->_db);
         student_grade::delete_records($filter, $this->_db);
         waitlist::delete_records($filter, $this->_db);
         parent::delete();
         $context = \local_elisprogram\context\pmclass::instance($this->id);
         $context->delete();
     }
 }