-
Notifications
You must be signed in to change notification settings - Fork 985
/
Survey_dynamic.php
58 lines (54 loc) · 1.41 KB
/
Survey_dynamic.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
* LimeSurvey
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
* All rights reserved.
* License: GNU/GPL License v2 or later, see LICENSE.php
* LimeSurvey is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
* $Id: common_helper.php 11335 2011-11-08 12:06:48Z c_schmitz $
* Files Purpose: lots of common functions
*/
class Survey_dynamic extends CActiveRecord
{
protected $sid = 0;
/**
* Returns the static model of Settings table
*
* @static
* @access public
* @param int $surveyid
* @return CActiveRecord
*/
public static function model($sid)
{
$instance = parent::model(__CLASS__);
$instance->sid = $sid;
return $instance;
}
/**
* Returns the setting's table name to be used by the model
*
* @access public
* @return string
*/
public function tableName()
{
return '{{survey_' . $this->sid . '}}';
}
/**
* Returns the primary key of this table
*
* @access public
* @return string
*/
public function primaryKey()
{
return 'sid';
}
}
?>