Documentation

Professor extends User
in package
implements JsonSerializable

Class Professor

Represents a professor who can make up to 3 loans

Table of Contents

Interfaces

JsonSerializable

Properties

$email  : string
User email
$id  : int
User ID
$loanAmount  : int
Number of loans the user can make
$name  : string
Username
$registration  : string
User registration
$role  : Role
User role

Methods

__construct()  : mixed
Constructor of the Professor class
canTakeOutMoreLoans()  : bool
Checks if the professor can make more loans
getEmail()  : string
Gets the user email
getId()  : int
Gets the user ID
getLoanAmount()  : int
Gets the number of loans the user can make
getName()  : string
Gets the username
getRegistration()  : string
Gets the user registration
getRole()  : Role
Gets the user role
jsonSerialize()  : array<string|int, mixed>
setEmail()  : self
Sets the user email
setId()  : self
Sets the user ID
setLoanAmount()  : self
Sets the number of loans the user can make
setName()  : self
Sets the username
setRegistration()  : self
Sets the user registration
setRole()  : self
Sets the user role

Properties

$email

User email

private string $email

$id

User ID

private int $id

$loanAmount

Number of loans the user can make

private int $loanAmount

$name

Username

private string $name

$registration

User registration

private string $registration

Methods

__construct()

Constructor of the Professor class

public __construct() : mixed

Initializes the maximum loan amount to 3.

canTakeOutMoreLoans()

Checks if the professor can make more loans

public canTakeOutMoreLoans(int $amountCurrentLoans) : bool
Parameters
$amountCurrentLoans : int

Current number of loans

Return values
bool

Returns true if the professor can make more loans

getEmail()

Gets the user email

public getEmail() : string
Return values
string

getId()

Gets the user ID

public getId() : int
Return values
int

getLoanAmount()

Gets the number of loans the user can make

public getLoanAmount() : int
Return values
int

getName()

Gets the username

public getName() : string
Return values
string

getRegistration()

Gets the user registration

public getRegistration() : string
Return values
string

getRole()

Gets the user role

public getRole() : Role
Return values
Role

jsonSerialize()

public jsonSerialize() : array<string|int, mixed>
Tags
inheritDoc
Return values
array<string|int, mixed>

setEmail()

Sets the user email

public setEmail(string $email) : self
Parameters
$email : string

User email

Return values
self

setId()

Sets the user ID

public setId(int $id) : self
Parameters
$id : int

User ID

Return values
self

setLoanAmount()

Sets the number of loans the user can make

public setLoanAmount(int $loanAmount) : self
Parameters
$loanAmount : int

Number of loans

Return values
self

setName()

Sets the username

public setName(string $name) : self
Parameters
$name : string

Username

Return values
self

setRegistration()

Sets the user registration

public setRegistration(string $registration) : self
Parameters
$registration : string

User registration

Return values
self

setRole()

Sets the user role

public setRole(Role $role) : self
Parameters
$role : Role

User role

Return values
self

        
On this page

Search results