Class CryptMySQLSource
A MySQL based data source object for the CryptUsers.
-
BSN\CryptUser\CryptMySQLSource
implements
BSN\CryptUser\CryptDataSource
Methods summary
public
|
#
__construct( mixed $databaseConfig )
Constructor to set up the data source
Constructor to set up the data source
|
private
|
|
public
string
|
#
getSourceType( )
Get source type
Returns
string The data source type.
Implementation of
|
public
array|boolean
|
#
getUserByName( string $username )
Get array of users that match a given name.
Get array of users that match a given name.
Parameters
- $username
string $username The username to search for in the data source.
Returns
array|boolean An array of arrays containing user elements to create a user or FALSE if not
found.
Implementation of
|
public
array
|
#
getUsernames( )
Get a list of usernames
Returns
array An array of strings containing the usernames from the data source.
Implementation of
|
public
boolean
|
#
saveUser( array $user )
Save the provided user details in the data source.
Save the provided user details in the data source.
Parameters
- $user
array $user An array of user elements to be saved.
Returns
boolean Returns TRUE on success and FALSE on failure.
Implementation of
|
public
boolean
|
#
deleteUser( string $username )
Delete the specified user from the data source.
Delete the specified user from the data source.
Parameters
- $username
string $username The username of the user to delete.
Returns
boolean Returns TRUE on success and FALSE on failure.
Implementation of
|
private
integer|boolean
|
#
searchUsersForUser( array $users, mixed $username )
Search provided users array for the specified user.
Search provided users array for the specified user.
Parameters
- $users
array $users An array of user rows to search.
- $username
Returns
integer|boolean The array index for the user name or FALSE if not found.
|
public
string
|
#
getCreateUserTableSQL( )
Get SQL to create users table.
Get SQL to create users table.
Returns
string SQL statement to create user table.
|
public
boolean
|
#
createUsersTable( string $createSQL = NULL )
Create users table.
Parameters
- $createSQL
string $createSQL Optional SQL statement to create the users table.
Returns
boolean TRUE on success, FALSE on failure.
|
public
boolean
|
#
usersTableExists( )
Check to see if users table exists
Check to see if users table exists
Returns
boolean TRUE if table exists, FALSE if table does not exist.
|
public
|
#
__wakeup( )
The magic __wakeup() function is used to reconnect to the database when the
object is unserialized.
The magic __wakeup() function is used to reconnect to the database when the
object is unserialized.
|