Documentation

User

An interface defining a User Pipit Core doesn't really need to know anything specific about a User class beyond its existence, but defining this interface helps guarantee consistency between client app User implementations.

Tags
author

Jason Savell jsavell@library.tamu.edu

Table of Contents

Methods

getProfile()  : array<string|int, mixed>
Returns the User's profile
getProfileValue()  : mixed
Retrieves a particular profile value from the User's profile
isAdmin()  : bool
Checks if the User is in the administrator class
isLoggedIn()  : bool
Checks if the user has a session
logIn()  : bool
Log in a User
logOut()  : bool
Ends a logged in User's session

Methods

getProfile()

Returns the User's profile

public getProfile() : array<string|int, mixed>
Return values
array<string|int, mixed>

getProfileValue()

Retrieves a particular profile value from the User's profile

public getProfileValue(string $field) : mixed
Parameters
$field : string

The name of the profile value to retrieve

Return values
mixed

The value of the profile $field, null if the $field is not present on the profile

isAdmin()

Checks if the User is in the administrator class

public isAdmin() : bool
Return values
bool

isLoggedIn()

Checks if the user has a session

public isLoggedIn() : bool
Return values
bool

True if logged in, false if not

logIn()

Log in a User

public logIn(string $username, string $password) : bool
Parameters
$username : string

The User's username

$password : string

The User's password

Return values
bool

True on successful login, false on anything else

logOut()

Ends a logged in User's session

public logOut() : bool
Return values
bool

True on success, false on failure


        
On this page

Search results