root/trunk/lib/model/SnippetUserPeer.php

Revision 2, 0.9 kB (checked in by fabien, 6 years ago)

initial import

  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3   // include base peer class
4   require_once 'model/om/BaseSnippetUserPeer.php';
5  
6   // include object class
7   include_once 'model/SnippetUser.php';
8
9
10 /**
11  * Skeleton subclass for performing query and update operations on the 'sn_user' table.
12  *
13  *
14  *
15  * You should add additional methods to this class to meet the
16  * application requirements.  This class will only be generated as
17  * long as it does not already exist in the output directory.
18  *
19  * @package model
20  */   
21 class SnippetUserPeer extends BaseSnippetUserPeer
22 {
23   public static function retrieveByLogin($login)
24   {
25     $c = new Criteria();
26     $c->add(self::LOGIN, $login);
27
28     return self::doSelectOne($c);
29   }
30
31   public static function getAuthenticatedUser($login, $password)
32   {
33     $user = self::retrieveByLogin($login);
34
35     // nickname exists?
36     // password is OK?
37     if ($user && $password == $user->getPassword())
38     {
39       return $user;
40     }
41
42     return null;
43   }
44 }
45
Note: See TracBrowser for help on using the browser.