]> dev.renevier.net Git - syj.git/blobdiff - application/models/UserMapper.php
ajax for account creation to known if a pseudo is available
[syj.git] / application / models / UserMapper.php
index 67faea8e20a69f64c303258c8385c0d3de3b6604..3fc84aa237ee4a832855a807b8611350cd52a66e 100644 (file)
@@ -24,6 +24,17 @@ class Syj_Model_UserMapper
         return true;
     }
 
+    public function findByPseudo($pseudo, Syj_Model_User $user) {
+        $table = $this->getDbTable();
+        $select = $table->select()->where('pseudo = ?', (string)$pseudo);
+        $row = $table->fetchRow($select);
+        if (!$row) {
+            return false;
+        }
+        $this->_itemFromRow($user, $row);
+        return true;
+    }
+
     public function findByEmail($email, Syj_Model_User $user) {
         $table = $this->getDbTable();
         $select = $table->select()->where('email = ?', (string)$email);