Author: allyb
Date: 2010-01-13 12:00:36 +0100 (Wed, 13 Jan 2010)
New Revision: 26562

Modified:
   plugins/sfEasyAuthPlugin/trunk/lib/model/sfEasyAuthUserBasePeer.php
Log:
Bug fix for retrieveByProfileId

Modified: plugins/sfEasyAuthPlugin/trunk/lib/model/sfEasyAuthUserBasePeer.php
===================================================================
--- plugins/sfEasyAuthPlugin/trunk/lib/model/sfEasyAuthUserBasePeer.php 
2010-01-13 10:28:28 UTC (rev 26561)
+++ plugins/sfEasyAuthPlugin/trunk/lib/model/sfEasyAuthUserBasePeer.php 
2010-01-13 11:00:36 UTC (rev 26562)
@@ -45,19 +45,20 @@
   }
 
   /**
-   * Retrieve a user by a profile id, or null if no user exists
-   * with that profile id
+   * Retrieves a user by a credential and profile id
    *
-   * @param int $profileId
-   * @return mixed
+   * @param string $credential The name of a credential
+   * @param int $profileId A profile ID
+   * @return object|null
    */
-  public static function retrieveByProfileId($profileId)
+  public static function retrieveByProfileId($credential, $profileId)
   {
     // first, try to retrieve a user whose default profile id is $profileId
     $c = new Criteria();
+    $c->add(self::TYPE, $credential);
     $c->add(self::PROFILE_ID, $profileId);
 
-    if ($user = self::doSelect($c))
+    if ($user = self::doSelectOne($c))
     {
       return $user;
     }
@@ -65,9 +66,10 @@
     // if no user was returned, search the extra credentials table
     $c = new Criteria();
     $c->addJoin(self::PROFILE_ID, sfEasyAuthUserCredentialPeer::ID);
+    $c->add(self::TYPE, $credential);
     $c->add(sfEasyAuthUserCredentialPeer::PROFILE_ID, $profileId);
 
-    return self::doSelect($c);
+    return self::doSelectOne($c);
   }
 
   /**

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" 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-svn?hl=en.


Reply via email to