EliteConf
 All Data Structures Namespaces Files Functions Variables Pages
Conference.php
Go to the documentation of this file.
1 <?php
2 
17 class Conference extends CActiveRecord
18 {
24  public static function model($className=__CLASS__)
25  {
26  return parent::model($className);
27  }
28 
32  public function tableName()
33  {
34  return 'conference';
35  }
36 
40  public function rules()
41  {
42  // NOTE: you should only define rules for those attributes that
43  // will receive user inputs.
44  return array(
45  array('conf_date_begin, conf_date_end', 'required'),
46  array('name', 'length', 'max'=>100),
47  array('rooms, address', 'length', 'max'=>200),
48  array('endTime, startTime', 'length', 'max'=>50),
49  array('description', 'length', 'max'=>400),
50  // The following rule is used by search().
51  // Please remove those attributes that should not be searched.
52  array('conferenceid, name, rooms, endTime, startTime, conf_date_begin, conf_date_end, address, description', 'safe', 'on'=>'search'),
53  );
54  }
55 
59  public function relations()
60  {
61  // NOTE: you may need to adjust the relation name and the related
62  // class name for the relations automatically generated below.
63  return array(
64  );
65  }
66 
70  public function attributeLabels()
71  {
72  return array(
73  'conferenceid' => 'Conferenceid',
74  'name' => 'Name',
75  'rooms' => 'Rooms',
76  'endTime' => 'End Time',
77  'startTime' => 'Start Time',
78  'conf_date_begin' => 'Conf Date Begin',
79  'conf_date_end' => 'Conf Date End',
80  'address' => 'Address',
81  'description' => 'Description',
82  );
83  }
84 
89  public function search()
90  {
91  // Warning: Please modify the following code to remove attributes that
92  // should not be searched.
93 
94  $criteria=new CDbCriteria;
95 
96  $criteria->compare('conferenceid',$this->conferenceid,true);
97  $criteria->compare('name',$this->name,true);
98  $criteria->compare('rooms',$this->rooms,true);
99  $criteria->compare('endTime',$this->endTime,true);
100  $criteria->compare('startTime',$this->startTime,true);
101  $criteria->compare('conf_date_begin',$this->conf_date_begin,true);
102  $criteria->compare('conf_date_end',$this->conf_date_end,true);
103  $criteria->compare('address',$this->address,true);
104  $criteria->compare('description',$this->description,true);
105 
106  return new CActiveDataProvider($this, array(
107  'criteria'=>$criteria,
108  ));
109  }
110 }