Hi,
> Hi everyone.  Symfony is a great framework!  I have a project based on
> askeet thats been in development for a short while, and I already have
> a User table, model classes, with a fair amount of cooperation with
> other tables.

I'm in a similar situation as you as well .. we waited to integrate
sfGuard after some time and already have code based on our "normal"
user class. So far, the integration/transition is going well.

That said, I'm not sure what your actual question is.

> from sfGuardSecurityUser.  There are still several places in my app
> where it expects a different object than its getting, which is causing
> problems.

What sort of problems are you dealing with, exactly?

As you mentioned, sfGuard can retrieve a "profile" class/table that
has all "the extra" user info that your current object may have that
the normal sf_guard_user table doesn't.

To configure sfGuard to use your current class, this is what you'll
need to drop into your app.yml file:

all:
  sf_guard_plugin:
    profile_class: MyUserProfile
    profile_field_name: id

where the `profile_class` variable is set to the name of your current
"User" class that sfGuard is "taking over" and `profile_field_name` is
the name column in your `profile_class` that is the foreign_key into
the sfGuard's `id`

Finally, you can access your current user class by calling the
sfGuardUser->getProfile() method.

You may find it convenient to add methods to the sfGuardUser class
that delegate to your inner profile so the amount of changes you do to
your existing codebase is minimal.

For instance, say your `MyUserProfile` class has a `doSomething`
method. Instead of changing your existing code to do something like:

$user->getProfile()->doSomething()` you can just add a `doSomething`
method to the sfGuardUser class that encapsulates this for you:

class sfGuardUser {

...

public function doSomething() {
  return $this->getProfile()->doSomething();
}

}

That's all the advice I have for you at the moment ... hope it helps,
-steve


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to