Public Member Functions | |
UserList () | |
Class constructor. | |
fillWithDatabase () | |
Fill in the list using the database. | |
databaseItemExists ($userId, $username) | |
Check if a user exists. | |
databaseInsertItem ($name) | |
Insert a new user. | |
databaseUpdateItem ($userId, $newName) | |
Update an existing user. | |
databaseDeleteItemsExcluding ($idArray) | |
Delete an existing user. | |
Public Attributes | |
$emptyListMessage = "There are no users to display." | |
The empty list message. | |
$alreadyExistsMessage = "Sorry, that user already exists. Please choose a different username." | |
The already existing message. |
This class can generate dynamic userlists in an HTML form.
UserList::UserList | ( | ) |
UserList::fillWithDatabase | ( | ) |
Fill in the list using the database.
This function is responsible for filling in the list using data from the database.
UserList::databaseItemExists | ( | $ | userId, | |
$ | username | |||
) |
Check if a user exists.
This function returns boolean true if a user exists.
userId | The userID to search for. | |
username | The username to search for. |
UserList::databaseInsertItem | ( | $ | name | ) |
Insert a new user.
This function will insert a new user in the database.
UserList::databaseUpdateItem | ( | $ | userId, | |
$ | newName | |||
) |
Update an existing user.
This function will update an existing user in the database.
userId | The userId of the user. | |
newName | The new name of the user. |
UserList::databaseDeleteItemsExcluding | ( | $ | idArray | ) |
Delete an existing user.
This function is responsible for removing an user from the database.
name | The name of the user. |
UserList::$emptyListMessage = "There are no users to display." |
The empty list message.
UserList::$alreadyExistsMessage = "Sorry, that user already exists. Please choose a different username." |
The already existing message.