Skip to content

6.1 Model Structure

Taufik Firmansyah edited this page Jul 15, 2015 · 2 revisions

Every Model generated by code builder will have same structure and code

Model code
class ModuleModel extends SB_Model {
                        
    public $table = 'table';
    public $primaryKey = 'key';

    public function __construct() {
      parent::__construct();
      
    }

    public static function querySelect()
    {                                                   
      return " SELECT table.* FROM table ";
    }
    public static function queryWhere()
    {                          
      return " WHERE table.key IS NOT NULL ";
    }
    
    public static function queryGroup()
    {
      return "  ";
    }
    
}

Clone this wiki locally