Class: User_Model

Source Location: /tinymvc/myapp/models/user_model.php

Class Overview [line 10]

AbstractModel
   |
   --User_Model

Data model for users. Handles all data-related user functions, and also handles login, logout, and registration.

Author(s):

  • Monte Ohrt

Version:

Copyright:

Variables

Constants

Methods


Inherited Variables

Inherited Constants

Inherited Methods

Class: AbstractModel

AbstractModel::__construct()
class constructor


Class Details

Data model for users. Handles all data-related user functions, and also handles login, logout, and registration.

Tags:

[ Top ]


Class Variables


Class Methods

getArray

void getArray( )

[line 239]

Gets an associate array. Designed for easy passing data to template.

Parameters:

[ Top ]

id

void id( )

[line 165]

Gets the user's id.

Parameters:

[ Top ]

isLoggedIn

bool isLoggedIn( )

[line 156]

Gets whether the user is logged in.

Tags:

  • return - True if user is logged in, False if user is an anonymous user.

Parameters:

[ Top ]

login

bool login( string $username, string $password)

[line 95]

Logs in the user given username and password.

Tags:

  • return - True if login successful, False otherwise.

Parameters:

  • string $username - The username.
  • string $password - The md5'd password.

[ Top ]

logout

void logout( )

[line 123]

Logs out the currently logged in user.

Does nothing if the user is already logged out.

Parameters:

[ Top ]

password

bool password( string $newPassword)

[line 216]

Gets (or sets) the user's password.

Tags:

  • return - True iff successful.

Parameters:

  • string $newPassword - The new password to use. Must not be md5'd yet.

[ Top ]

register

bool register( string $username, string $password)

[line 136]

Registers a new user using the given information.

Tags:

  • return - True if registration successful, False otherwise.

Parameters:

  • string $username - The desired username.
  • string $password - The desired password.

[ Top ]

username

void username( )

[line 179]

Gets the user's username.

Parameters:

[ Top ]

zipCode

void zipCode( [ $set = null])

[line 188]

Gets (or sets) the user's zip code.

Parameters:

  • $set -

[ Top ]


Class Constants


Documentation generated on Tue, 26 May 2009 14:50:39 -0700 by phpDocumentor 1.4.1