Advertisement
terorama

mvc / question.inc.php

Dec 22nd, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.90 KB | None | 0 0
  1. <?php
  2.  
  3. //-------------------------------------------------
  4. //            question model
  5. //-------------------------------------------------
  6. class Question extends Model {
  7.  
  8.    protected $_table = 'questions';
  9.    protected $_idfield = 'qid';
  10.    
  11.    protected $fields = array (
  12.       array('fn'=>'qtitle', 'ft'=>'s'),
  13.       array('fn'=>'qtext','ft'=>'s'),
  14.       array('fn'=>'qcategory','ft'=>'i', 'lookup'=>'category'),
  15.       array('fn'=>'quser','ft'=>'i', 'lookup'=>'user'),
  16.       array('fn'=>'qdate','ft'=>'s'));
  17.      
  18.    protected $_postvars = array ('qtitle'=>'', 'qtext'=>'', 'qcategory'=>'', 'quser'=>'');
  19.    
  20.    //-----------------------------------------
  21.    protected function setAutoVars() {
  22.    
  23.       $this->a__qdate = date('Y-m-d H:i:s');
  24.    }
  25.    
  26.    //-----------------------------------------
  27.    public function getCategory($category) {
  28.       return 'not implemented yet';
  29.    }
  30.    
  31.  
  32. }
  33.  
  34. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement