Author: allyb
Date: 2010-02-20 19:17:19 +0100 (Sat, 20 Feb 2010)
New Revision: 28158

Added:
   
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserCredentialBase.php
Modified:
   
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserCredential.php.propel
Log:
Created an easy auth credential base class

Modified: 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserCredential.php.propel
===================================================================
--- 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserCredential.php.propel
  2010-02-20 18:07:13 UTC (rev 28157)
+++ 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserCredential.php.propel
  2010-02-20 18:17:19 UTC (rev 28158)
@@ -1,29 +1,5 @@
 <?php
 
-class sfEasyAuthUserCredential extends BasesfEasyAuthUserCredential
+class sfEasyAuthUserCredential extends sfEasyAuthUserCredentialBase
 {
-  /**
-   * Deletes profiles that are related with a credential when the 
-   * credential is deleted
-   * 
-   * @param PropelPDO $con 
-   */
-  public function delete(PropelPDO $con = null)
-  {
-    if ($this->getProfileId() !== null)
-    {
-      // retrieve the associated user
-      if ($eaUser = sfEasyAuthUserPeer::retrieveByPK($this->getUserId()))
-      {
-        // try to retrive the profile
-        $getter = sfEasyAuthUser::getProfileGetter($this->getCredential());
-        if ($profile = $eaUser->{$getter}())
-        {
-          $profile->delete();
-        }
-      }
-    }
-
-    return parent::delete($con);
-  }
 }

Added: 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserCredentialBase.php
===================================================================
--- 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserCredentialBase.php
                             (rev 0)
+++ 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserCredentialBase.php
     2010-02-20 18:17:19 UTC (rev 28158)
@@ -0,0 +1,29 @@
+<?php
+
+class sfEasyAuthUserCredentialBase extends BasesfEasyAuthUserCredential
+{
+  /**
+   * Deletes profiles that are related with a credential when the 
+   * credential is deleted
+   * 
+   * @param PropelPDO $con 
+   */
+  public function 
delete(Doctrine_Connection/*&PropelPDO###Doctrine_Connection&*/ $con = null)
+  {
+    if ($this->getProfileId() !== null)
+    {
+      // retrieve the associated user
+      if ($eaUser = 
Doctrine::getTable('sfEasyAuthUser')->find/*&sfEasyAuthUserPeer::retrieveByPK###Doctrine::getTable('sfEasyAuthUser')->find&*/($this->getUserId()))
+      {
+        // try to retrive the profile
+        $getter = sfEasyAuthUser::getProfileGetter($this->getCredential());
+        if ($profile = $eaUser->{$getter}())
+        {
+          $profile->delete();
+        }
+      }
+    }
+
+    return parent::delete($con);
+  }
+}

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