| Users | |
| Author | Jaybill McCarthy |
| License | http://communit.as/docs/license |
| See Also | Cts_Db_Table_Abstract |
| Constructors | |
| Users | Calls the parent’s constructor and instantiates a logger. |
| Instance Methods | |
| insert | Inserts a user into the database. |
| isEmailInUse | Determines whether a particular email address already exists in the database. |
| fetchByUsername | Gets a set of user data for a particular username from the database. |
| delete | Delete a user from the database. |
| update | Updates the attributes of a user in the database. |
| userExists | Used to determine if a user exists. |
| fetchByRoleId | Gets all users in a particular role. |
| isUserInRole | Indicates whether a certain user has a certain role. |
| setMetaData | Updates the metadata object for a user. |
| getMetaData | Updates the metadata object for a user. |
| getRecentlyRegistered | Fetches a list of those users who have most recently registered. |
| getRecentlyUpdated | Fetches a list of those users who have most recently updated. |
| getRecentlyOnline | Fetches a list of those users who have most recently logged into the app. |
| Static Methods | |
| getAvatarPath | Gets full path to avatar. |
| clearUserCache | Deletes all of a particular user’s images from the server cache. |
| Private or Protected Methods | |
| parseTags |
public function isEmailInUse( $email, $username = null )
Determines whether a particular email address already exists in the database.
| The email address string to look for. | |
| username (optional) | If specified, the username gets added to the where clause so you can see if an email address is being used with a particular username. |
A boolean indicating whether the email exists (true) or does not (false).
public function delete( $where )
Delete a user from the database.
| where | A where clause string to limit the rows that get deleted. If the where clause is empty, all users will be deleted! |
| param username | The username of the user to delete. |
TBD
public function update( array $data, $where )
Updates the attributes of a user in the database.
| data | An array with a key-value pair for each column in the users table. |
| where | A where clause string to limit the rows that get updated. If the where clause is empty, all users will be updated with the data argument. |
TBD
function getAvatarPath( $username, $include_filename = false )
Gets full path to avatar. You should always use this instead of referencing the avatar directly. Should be used both when storing an avatar and retrieving it.
| username | The username of the user whose avatar is needed. |
| include_filename (optional) | Whether or not to include the filename or just the directory. Defaults to false. |
| param path | the default path to the avatar. |
Calls the parent’s constructor and instantiates a logger.
public function Users()
Inserts a user into the database.
public function insert( array $data )
Determines whether a particular email address already exists in the database.
public function isEmailInUse( $email, $username = null )
Gets a set of user data for a particular username from the database.
public function fetchByUsername( $username )
Delete a user from the database.
public function delete( $where )
Updates the attributes of a user in the database.
public function update( array $data, $where )
Used to determine if a user exists.
public function userExists( $username )
Gets all users in a particular role.
function fetchByRoleId( $role_id )
Indicates whether a certain user has a certain role.
function isUserInRole( $username, $role_id )
Updates the metadata object for a user.
function setMetaData( $username, $key, $value )
Updates the metadata object for a user.
function getMetaData( $username, $key = null )
Fetches a list of those users who have most recently registered.
function getRecentlyRegistered( $how_many )
Fetches a list of those users who have most recently updated.
function getRecentlyUpdated( $how_many )
Fetches a list of those users who have most recently logged into the app.
function getRecentlyOnline( $how_many )
Gets full path to avatar.
function getAvatarPath( $username, $include_filename = false )
Deletes all of a particular user’s images from the server cache.
static function clearUserCache( $username )
protected function parseTags( $all_tags )