Search code examples
symfony-1.4sfdoctrineguardsfguardsymfony-plugins

sfDoctrineGuardPlugin relations with sfDoctrineApplyPlugin (delete and create users)


I use symfony 1.4.11. I use sfDoctrineGuardPlugin and sfDoctrineApplyPlugin.All works fine, but... In my backend I have user list, where I can manage users.When I create new user from backend, his profile create only in sf_guard_user table, or when I delete user from backend , it deleted his profile only from sf_guard_user table, , but it do not delete his profile from sf_guard_user_profile table...So how to fix it?Maybe I am made something wrong in cofiguration of both plugins? Thank you!

sfGuardUserProfile:
  connection: doctrine
  tableName: sf_guard_user_profile
  columns:
    id:            { type: integer(4), primary: true, autoincrement: true }
    user_id:       { type: integer(4), notnull: true , primary: false }
    salutation:    { type: string(10), notnull: true }
    first_name:    { type: string(30), notnull: true }
    last_name:     { type: string(30), notnull: true }
    country:       { type: string(255), notnull: true }
    postcode:      { type: string(10) , notnull: true }
    city:          { type: string(255), notnull: true }
    address:       { type: string()   , notnull: true }
    phone:         { type: string(50) }
    email:         { type: string(255), notnull: true }
    validate:      { type: string(17) }
    banned:        { type: boolean, default: 0 }
    payed_until:   { type: datetime, notnull: true}
  relations:
    User:
      class: sfGuardUser
      foreign: id
      local: user_id
      type: one
      onDelete: cascade
      foreignType: one
      foreignAlias: Profile

Solution

  • Just change my database from MyISAM to INNODB and all works fine!