Example #1
0
 /**
  * Add param fields to the form object
  */
 public function to_object()
 {
     $obj = parent::to_object();
     $prof_fields = $this->_db->get_records(userset_profile::TABLE, array('clusterid' => $this->id), '', '*', 0, 2);
     if (!empty($prof_fields)) {
         foreach (range(1, 2) as $i) {
             $profile = pos($prof_fields);
             if (!empty($profile)) {
                 $field = 'profile_field' . $i;
                 $value = 'profile_value' . $i;
                 $obj->{$field} = $profile->fieldid;
                 $obj->{$value} = $profile->value;
             }
             next($prof_fields);
         }
     }
     return $obj;
 }
Example #2
0
 /**
  * Add param fields to the form object
  */
 public function to_object()
 {
     $obj = parent::to_object();
     $mdlcrsid = $this->get_moodle_course_id();
     if ($mdlcrsid != 0) {
         $obj->moodlecourseid = $mdlcrsid;
     }
     return $obj;
 }