ACL Extension  0.3
 All Data Structures Namespaces Files Functions Variables
Permission.php
Go to the documentation of this file.
1 <?php
2 
27 class Permission extends CActiveRecord
28 {
29 
35  public static function model($className=__CLASS__)
36  {
37  return parent::model($className);
38  }
39 
43  public function tableName()
44  {
45  return '{{permission}}';
46  }
47 
51  public function rules()
52  {
53  // NOTE: you should only define rules for those attributes that
54  // will receive user inputs.
55  return array(
56  );
57  }
58 
62  public function relations()
63  {
64  // NOTE: you may need to adjust the relation name and the related
65  // class name for the relations automatically generated below.
66  //
67  return array(
68  'Aco' => array(static::BELONGS_TO, Strategy::getClass('AcoNode'), 'aco_id'),
69  'Aro' => array(static::BELONGS_TO, Strategy::getClass('AroNode'), 'aro_id'),
70  'Action' => array(static::BELONGS_TO, 'Action', 'action_id')
71  );
72  }
73 
77  public function attributeLabels()
78  {
79  return array(
80  'id' => 'ID',
81  'aco_id' => 'Aco',
82  'aro_id' => 'Aro',
83  'aco_path' => 'Aco Path',
84  'aro_path' => 'Aro Path',
85  'action_id' => 'Action',
86  );
87  }
88 
93  public function search()
94  {
95  // Warning: Please modify the following code to remove attributes that
96  // should not be searched.
97 
98  $criteria=new CDbCriteria;
99 
100  $criteria->compare('id',$this->id);
101  $criteria->compare('aco_id',$this->aco_id);
102  $criteria->compare('aro_id',$this->aro_id);
103  $criteria->compare('action_id',$this->action_id);
104 
105  return new CActiveDataProvider($this, array(
106  'criteria'=>$criteria,
107  ));
108  }
109 
114  public function __clone(){
115  $this->id = NULL;
116  $this->isNewRecord = true;
117  }
118 }
119 
120 ?>