Author: allyb
Date: 2010-02-21 22:42:58 +0100 (Sun, 21 Feb 2010)
New Revision: 28169

Modified:
   
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserBase.php
Log:
Overridden setters properly for doctrine

Modified: 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserBase.php
===================================================================
--- 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserBase.php
       2010-02-21 18:22:56 UTC (rev 28168)
+++ 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserBase.php
       2010-02-21 21:42:58 UTC (rev 28169)
@@ -258,14 +258,17 @@
 
     $profileArray = array();
 
-    // get an array of profiles
-    foreach 
(Doctrine::getTable('sfEasyAuthUserCredential')->findOneByUserId/*&sfEasyAuthUserCredentialPeer::retrieveByUserId###Doctrine::getTable('sfEasyAuthUserCredential')->findOneByUserId&*/($this->getId())
 as $credential)
+    if ($this->getId())
     {
-      $method = self::getProfileGetter($credential->getCredential());
+      // get an array of profiles
+      foreach 
(Doctrine::getTable('sfEasyAuthUserCredential')->findOneByUserId/*&sfEasyAuthUserCredentialPeer::retrieveByUserId###Doctrine::getTable('sfEasyAuthUserCredential')->findOneByUserId&*/($this->getId())
 as $credential)
+      {
+        $method = self::getProfileGetter($credential->getCredential());
 
-      if ($profile = $this->$method())
-      {
-        $profileArray[] = $profile;
+        if ($profile = $this->$method())
+        {
+          $profileArray[] = $profile;
+        }
       }
     }
 
@@ -444,7 +447,7 @@
       }
     }
     
-    return parent::setUsername($username);
+    return $this->_set('username', 
$username)/*&parent::setUsername($username)###$this->_set('username', 
$username)&*/;
   }
   
   /**
@@ -463,7 +466,7 @@
         $this->hashPassword($password, true) : $password; 
     
       // set the password
-      return parent::setPassword($hashedPassword);
+      return $this->_set('password', 
$hashedPassword)/*&parent::setPassword($hashedPassword)###$this->_set('password',
 $hashedPassword)&*/;
     }
   }
   

-- 
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