pclib  2.3.2
Lightweight PHP framework
Public Member Functions | Data Fields | Protected Member Functions
AuthDbStorage Class Reference

Default Auth storage. More...

Inheritance diagram for AuthDbStorage:
BaseObject

Public Member Functions

 getUser ($userName)
 Load user data from database and return AuthUser object. More...
 
 setUser (AuthUser $user)
 Update user values. More...
 
 getCredentials ($userId)
 Return userName, password and default password. More...
 
- Public Member Functions inherited from BaseObject
 loadDefaults ($className=null)
 Load default parameters of class $className into object instance.
 
 setProperties (array $defaults)
 Set public properties of object from the array. More...
 
 addEvent ($name, $callback)
 Add event handler to $object->$name property. More...
 
 toArray ()
 Convert object to array. More...
 

Data Fields

 $db
 var Db
 
- Data Fields inherited from BaseObject
 $onNewInstance
 Occurs when new instance of the class is created. More...
 
 $onMissingMethod
 Occurs when called method does not exist. More...
 
 $serviceLocator
 var function() Return service object when requested with service(). More...
 

Protected Member Functions

 getData ($userName)
 Get data from AUTH_USER, except password and default password. More...
 
 getRoles ($userId)
 Get user roles. More...
 
 getRights ($userId, array $roles)
 Get user rights. More...
 
- Protected Member Functions inherited from BaseObject
 fireEvent ($name, array $args=array())
 Run all event handlers in $object->$name property. More...
 
 service ($service, $default=null)
 Try acquire $service and load it into property $this->$service. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from BaseObject
static defaults ()
 Set or retireve default parameters of the object. More...
 

Detailed Description

Default Auth storage.

Load user account, roles and rights from database table.

Member Function Documentation

getCredentials (   $userId)

Return userName, password and default password.

Parameters
int$userId
Returns
array $credentials
getData (   $userName)
protected

Get data from AUTH_USER, except password and default password.

getRights (   $userId,
array  $roles 
)
protected

Get user rights.

getRoles (   $userId)
protected

Get user roles.

getUser (   $userName)

Load user data from database and return AuthUser object.

Parameters
string$userName
Returns
AuthUser|null $user
setUser ( AuthUser  $user)

Update user values.

Parameters
AuthUser$user

The documentation for this class was generated from the following file: