Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // app.yml
- all:
- sf_guard_plugin:
- profile_class: sfGuardUserProfile
- profile_field_name: user_id
- // schema.yml
- sfGuardUserProfile:
- tableName; sf_guard_user_profile
- columns:
- user_id:
- type: integer(4)
- notNull: true
- email:
- type: string(255)
- birthday:
- type: date
- relations:
- User:
- class: sfGuardUser
- local: user_id
- foreign: id
- foreignAlias: Profile
- onDelete: CASCADE
- // sfGuardUserProfile.class.php
- public function preInsert($event)
- {
- $this->email = $this->User->username;
- }
- // or sfGuardUser.class.php
- public function preInsert($event)
- {
- $this->username = $this->Profile->email;
- }
Add Comment
Please, Sign In to add comment