Guest User

Untitled

a guest
Jun 22nd, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. // app.yml
  2. all:
  3. sf_guard_plugin:
  4. profile_class: sfGuardUserProfile
  5. profile_field_name: user_id
  6.  
  7.  
  8. // schema.yml
  9.  
  10. sfGuardUserProfile:
  11. tableName; sf_guard_user_profile
  12. columns:
  13. user_id:
  14. type: integer(4)
  15. notNull: true
  16. email:
  17. type: string(255)
  18. birthday:
  19. type: date
  20. relations:
  21. User:
  22. class: sfGuardUser
  23. local: user_id
  24. foreign: id
  25. foreignAlias: Profile
  26. onDelete: CASCADE
  27.  
  28. // sfGuardUserProfile.class.php
  29.  
  30. public function preInsert($event)
  31. {
  32. $this->email = $this->User->username;
  33. }
  34.  
  35. // or sfGuardUser.class.php
  36.  
  37. public function preInsert($event)
  38. {
  39. $this->username = $this->Profile->email;
  40. }
Add Comment
Please, Sign In to add comment