Author: allyb
Date: 2010-02-21 13:13:20 +0100 (Sun, 21 Feb 2010)
New Revision: 28161

Added:
   
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/
   
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUser.class.php
   
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUserCredential.class.php
   
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUserCredentialTable.class.php
   
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUserTable.class.php
Log:
Added the doctrine classes

Added: 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUser.class.php
===================================================================
--- 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUser.class.php
                              (rev 0)
+++ 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUser.class.php
      2010-02-21 12:13:20 UTC (rev 28161)
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * PluginsfEasyAuthUser
+ * 
+ * This class has been auto-generated by the Doctrine ORM Framework
+ * 
+ * @package    ##PACKAGE##
+ * @subpackage ##SUBPACKAGE##
+ * @author     ##NAME## <##EMAIL##>
+ * @version    SVN: $Id: Builder.php 6820 2009-11-30 17:27:49Z jwage $
+ */
+abstract class PluginsfEasyAuthUser extends sfEasyAuthUserBase
+{
+
+}
\ No newline at end of file

Added: 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUserCredential.class.php
===================================================================
--- 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUserCredential.class.php
                            (rev 0)
+++ 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUserCredential.class.php
    2010-02-21 12:13:20 UTC (rev 28161)
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * PluginsfEasyAuthUserCredential
+ * 
+ * This class has been auto-generated by the Doctrine ORM Framework
+ * 
+ * @package    ##PACKAGE##
+ * @subpackage ##SUBPACKAGE##
+ * @author     ##NAME## <##EMAIL##>
+ * @version    SVN: $Id: Builder.php 6820 2009-11-30 17:27:49Z jwage $
+ */
+abstract class PluginsfEasyAuthUserCredential extends 
sfEasyAuthUserCredentialBase
+{
+
+}
\ No newline at end of file

Added: 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUserCredentialTable.class.php
===================================================================
--- 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUserCredentialTable.class.php
                               (rev 0)
+++ 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUserCredentialTable.class.php
       2010-02-21 12:13:20 UTC (rev 28161)
@@ -0,0 +1,45 @@
+<?php
+/**
+ */
+class PluginsfEasyAuthUserCredentialTable extends Doctrine_Table
+{
+  /**
+   * Queries the user_credentials and user table to find all types and 
credentials that
+   * have been set
+   *
+   * @return array An associative array of credentials as strings
+   */
+  public static function getAllCredentialsAsArray()
+  {
+    $q = Doctrine_Query::create()
+      ->select('DISTINCT c.credential')
+      ->from('sfEasyAuthUserCredential c');
+
+    $credentials = array();
+
+    foreach ($q->execute() as $result)
+    {
+      $credentials[$result['credential']] = $result['credential'];
+    }
+
+    asort($credentials);
+
+    return $credentials;
+  }
+
+  /**
+   * Retrieves an sfEasyAuthUserCredential object by user ID and credential 
name
+   *
+   * @param int $userId An easy auth user ID
+   * @param string $credentialName The name of a credential, e.g. 'editor'
+   * @return array|null
+   */
+  public function findOneByUserIdAndName($userId, $credentialName)
+  {
+    $q = Doctrine_Query::create()->
+      from('sfEasyAuthUserCredential c')->
+      where('c.user_id = ? AND c.credential = ?', array($userId, 
$credentialName));
+
+    return $q->fetchOne();
+  }
+}
\ No newline at end of file

Added: 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUserTable.class.php
===================================================================
--- 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUserTable.class.php
                         (rev 0)
+++ 
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/doctrine/PluginsfEasyAuthUserTable.class.php
 2010-02-21 12:13:20 UTC (rev 28161)
@@ -0,0 +1,37 @@
+<?php
+/**
+ */
+class PluginsfEasyAuthUserTable extends Doctrine_Table
+{
+    /**
+   * Retrieves a user by a credential and profile id
+   *
+   * @param string $credential The name of a credential
+   * @param int $profileId A profile ID
+   * @return object|null
+   */
+  public function findOneByCredentialAndProfileId($credential, $profileId)
+  {
+    $q = Doctrine_Query::create()->
+      from('sfEasyAuthUser u')->
+      join('u.sfEasyAuthUserCredential c')->
+      where('c.credential = ? AND c.profile_id = ?', array($credential, 
$profileId));
+
+    return $q->fetchOne();
+  }
+
+    /**
+   * Retrieves a user by ID and auto-log-in hash
+   * @param int $id
+   * @param string $hash
+   * @return mixed
+   */
+  public function findOneByIdAndAutoLoginHash($id, $hash)
+  {
+    $q = Doctrine_Query::create()->
+      from('sfEasyAuthUser u')->
+      where('u.id = ? AND u.auto_login_hash = ?', array($id, $hash));
+
+    return $q->fetchOne();
+  }
+}
\ No newline at end of file

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