Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User extends CActiveRecord
- {
- public static function model($className=__CLASS__)
- {
- return parent::model($className);
- }
- public function tableName()
- {
- return 'user';
- }
- protected function beforeSave() {
- if(parent::beforeSave()) {
- // letakkan pengecekan di sini.
- if($checkOk)
- return true; // simpan
- else
- return false; // gagalkan penyimpanan
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement