Esempio n. 1
0
File: Basic.php Progetto: xepan/base
 function setModel($m, $id_field = null, $title_field = null)
 {
     parent::setModel($m);
     $this->id_field = $id_field ?: $this->model->id_field;
     $this->title_field = $title_field ?: $this->model->title_field;
     return $this->model;
 }
Esempio n. 2
0
 function setModel($m, $id_field = null, $title_field = null)
 {
     parent::setModel($m);
     $this->id_field = $id_field ?: $this->model->id_field;
     $this->title_field = $title_field ?: $this->model->title_field;
     if ($_GET[$this->name]) {
         if ($_GET['term']) {
             $this->addCondition($_GET['term']);
         }
         $data = $this->getData();
         foreach ($data as &$row) {
             //var_dump($row['_id']->__toString()); echo '<hr>';
             $row[$this->id_field] = (string) $row[$this->id_field];
         }
         echo json_encode($data);
         exit;
     }
 }
Esempio n. 3
0
 public function setModel($m, $id_field = null, $title_field = null)
 {
     parent::setModel($m);
     $this->id_field = $id_field ?: $this->model->id_field;
     $this->title_field = $title_field ?: $this->model->title_field;
     if ($_GET[$this->name]) {
         if ($_GET['term']) {
             $this->addCondition($_GET['term']);
         }
         // retrieve data from model
         $data = $this->getData();
         // cast values to string
         foreach ($data as &$row) {
             $row[$this->id_field] = (string) $row[$this->id_field];
         }
         echo json_encode($data);
         exit;
     }
 }
Esempio n. 4
0
 function setModel($m, $id_field = null, $title_field = null)
 {
     parent::setModel($m);
     $this->id_field = $id_field ?: $this->model->id_field;
     $this->title_field = $title_field ?: $this->model->title_field;
     if ($_GET[$this->name]) {
         if ($_GET['term']) {
             $this->addCondition($_GET['term']);
         }
         $data = $this->getData();
         echo json_encode($data);
         exit;
     }
 }