ci_pm  0.9
CodeIgniter Private Messaging Plugin
 All Data Structures Functions
Public Member Functions | Data Fields
User_model Class Reference

User Model. More...

Inheritance diagram for User_model:

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
 

Detailed Description

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.

Author
Balint Morvai
Version
0.9

Constructor & Destructor Documentation

__construct (   $dateformat = "d.m.Y - H:i",
  $enforce_field_types = TRUE 
)

User model constructor.

Parameters
dateformatstring: format to display dates in
enforce_field_typesbool: setting whether to enforce field types in PHP by cast
Returns
void

Member Function Documentation

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 !!!

Returns
int
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.

Parameters
usernamestring: username to get user id(s) for
exactbool: 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_countint: max number of ids returned if fuzzy search done
Returns
array
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.

Parameters
idint: user id to get user name for
Returns
string
initialize (   $dateformat = "d.m.Y - H:i",
  $enforce_field_types = TRUE 
)

initialize

Initializes values for this class.

Parameters
dateformatstring: format to display dates in
enforce_field_typesbool: setting whether to enforce field types in PHP by cast
Returns
void

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