EliteConf
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
test
protected
models
Message.php
Go to the documentation of this file.
1
<?php
2
10
class
Message
extends
CActiveRecord
11
{
17
public
static
function
model
($className=__CLASS__)
18
{
19
return
parent::model($className);
20
}
21
25
public
function
tableName
()
26
{
27
return
'tbl_message'
;
28
}
29
33
public
function
rules
()
34
{
35
// NOTE: you should only define rules for those attributes that
36
// will receive user inputs.
37
return
array(
38
array(
'content'
,
'required'
),
39
// The following rule is used by search().
40
// Please remove those attributes that should not be searched.
41
array(
'id, content'
,
'safe'
,
'on'
=>
'search'
),
42
);
43
}
44
48
public
function
relations
()
49
{
50
// NOTE: you may need to adjust the relation name and the related
51
// class name for the relations automatically generated below.
52
return
array(
53
);
54
}
55
59
public
function
attributeLabels
()
60
{
61
return
array(
62
'id'
=>
'ID'
,
63
'content'
=>
'Content'
,
64
);
65
}
66
71
public
function
search
()
72
{
73
// Warning: Please modify the following code to remove attributes that
74
// should not be searched.
75
76
$criteria=
new
CDbCriteria;
77
78
$criteria->compare(
'id'
,$this->
id
);
79
$criteria->compare(
'content'
,$this->content,
true
);
80
81
return
new
CActiveDataProvider($this, array(
82
'criteria'
=>$criteria,
83
));
84
}
85
}
Generated on Sun Jun 2 2013 05:35:38 for EliteConf by
1.8.4