Add a field in sf_guard_user

239 Views Asked by At

I'm using Symfony1.4 on a website. We are recasting it under Laravel5. Both versions are currently online and share the same database. We are using sfDoctrineGuardPlugin.

We added an integer field in sf_guard_user. It works fine in Laravel but we can't access its value under Symfony1.4. (I know we are not supposed to use directly sf_guard_user, but we have to stick with it for now, as SF1.4 version is going offline in a few weeks).

We added the field to the schema.yml, and a getter in the model (sfGuardUser.class.php).

Is there anything else we need to do in order to access the value of the field ?

1

There are 1 best solutions below

0
Marek On

Updating schema.yml should be enough, provided you also regenerate classes: ./symfony doctrine:build --all-classes

New field is not accessible directly on sfContext::getInstance->getUser(), but on returned guard user:

sfContext::getInstance->getUser()->getGuardUser()->getAdditionalField()