Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Db_Model_User extends Db_Model_BaseUser
- {
- public static function findAll(){
- return Doctrine::getTable('Db_Model_User')->findAll();
- }
- public static function find($id){
- return Doctrine::getTable('Db_Model_User')->find($id);
- }
- public function preInsert($event){
- $this->password = md5($this->password);
- }
- public function preUpdate($event){
- $this->password = md5($this->password);
- }
- }
- // Controller
- $user = Db_Model_User::find(id);
- $user->name = 'New name';
- $user->save();
- ?>
Add Comment
Please, Sign In to add comment