~fabiocbalbuquerque/sahana-agasti/web-services

« back to all changes in this revision

Viewing changes to lib/model/doctrine/agWebservicesPackage/sfGuardUserProfileTable.class.php

  • Committer: Clayton Kramer
  • Date: 2011-07-26 15:25:28 UTC
  • mto: (1.26.1 push-trunk)
  • mto: This revision was merged to the branch mainline in revision 25.
  • Revision ID: clayton.kramer@mail.cuny.edu-20110726152528-ut61tu1u7fwn95xb
Merged Fabio's webservices package

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
/**
 
4
 * sfGuardUserProfileTable
 
5
 * 
 
6
 * This class has been auto-generated by the Doctrine ORM Framework
 
7
 */
 
8
class sfGuardUserProfileTable extends PluginsfGuardUserProfileTable
 
9
{
 
10
    /**
 
11
     * Returns an instance of this class.
 
12
     *
 
13
     * @return object sfGuardUserProfileTable
 
14
     */
 
15
    public static function getInstance()
 
16
    {
 
17
        return Doctrine_Core::getTable('sfGuardUserProfile');
 
18
    }
 
19
    
 
20
    public function getByToken(array $parameters) 
 
21
    {
 
22
        $user = Doctrine_Core::getTable('sfGuardUserProfile')->findOneByToken($parameters['token']);
 
23
        if (!$user || !$user->getIsWebserviceClient() ||!$user->getIsActive())
 
24
        {
 
25
            throw new sfError404Exception(sprintf('Client with token "%s" does not exist or is not activated.', $parameters['token']));
 
26
        }
 
27
        return $user;
 
28
    }
 
29
}
 
 
b'\\ No newline at end of file'