Ejemplo n.º 1
0
 public function Find($d)
 {
     $utmf = Abricos::TextParser(true);
     $d->value = $utmf->Parser($d->value);
     switch ($d->type) {
         case 'Subject':
             $d->fieldid = intval($d->fieldid);
             $d->filterCourse = intval($d->filterCourse);
             $d->filterSemestr = intval($d->filterSemestr);
             $rows = RecordBookQuery::SubjectFind($this->db, $d);
             break;
         case 'Group':
             $d->frmstudy = $utmf->Parser($d->frmstudy);
             $rows = RecordBookQuery::GroupFind($this->db, $d);
             break;
         case 'Stud':
             $d->groupid = intval($d->groupid);
             $rows = RecordBookQuery::StudFind($this->db, $d);
             break;
         default:
             return false;
     }
     $listClass = $d->type . "List";
     $itemClass = $d->type . "Item";
     $list = $this->models->InstanceClass($listClass);
     while ($dd = $this->db->fetch_array($rows)) {
         $list->Add($this->models->InstanceClass($itemClass, $dd));
     }
     return $list;
 }