User Model. More...
Public Member Functions | |
__construct ($dateformat="d.m.Y - H:i", $enforce_field_types=TRUE) | |
User model constructor. More... | |
initialize ($dateformat="d.m.Y - H:i", $enforce_field_types=TRUE) | |
initialize More... | |
get_userids ($username, $exact=TRUE, $max_id_count=10) | |
Get user id from a username. More... | |
get_username ($id) | |
Get user name from an id. More... | |
current_id () | |
dummy method returning first user id found More... | |
Data Fields | |
$table1 | |
User Model.
The model works using one table: it contains the users. The model provides functions to get info on the users.
Copyright (c) 2015 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
__construct | ( | $dateformat = "d.m.Y - H:i" , |
|
$enforce_field_types = TRUE |
|||
) |
User model constructor.
dateformat | string: format to display dates in |
enforce_field_types | bool: setting whether to enforce field types in PHP by cast |
current_id | ( | ) |
dummy method returning first user id found
!!! DUMMY METHOD - IMPLEMENT THIS AS NEEDED !!! Get user id of current user. !!! DUMMY METHOD - IMPLEMENT THIS AS NEEDED !!!
get_userids | ( | $username, | |
$exact = TRUE , |
|||
$max_id_count = 10 |
|||
) |
Get user id from a username.
Get user id from a username - gets any users id. Per default performs an exact match search and returns 1 or 0 ids in enumerated array! (not CI result array) If you want a fuzzy search pass 2nd parameter FALSE. This will search for any name containing given string and return ids - the max number of returned ids (in the case of fuzzy search) is limited by the 3rd optional parameter. Returns an enumerated array in any case, containing 1 or more user ids or empty if no matches found.
username | string: username to get user id(s) for |
exact | bool: if TRUE, exact search, returns 1 or 0 user ids in array; if FALSE, fuzzy search, return 1 or more user ids in array |
max_id_count | int: max number of ids returned if fuzzy search done |
get_username | ( | $id | ) |
Get user name from an id.
Get user name from an id - gets any users name, not just logged in users. Returns a string with the username.
id | int: user id to get user name for |
initialize | ( | $dateformat = "d.m.Y - H:i" , |
|
$enforce_field_types = TRUE |
|||
) |
initialize
Initializes values for this class.
dateformat | string: format to display dates in |
enforce_field_types | bool: setting whether to enforce field types in PHP by cast |