-
Notifications
You must be signed in to change notification settings - Fork 8
Customer.php
- This document provides an overview of the file's structure and functionality.
- This document provides methods for manipulating customer details.
- Customer.php contains a single property
- Customer.php contains a variety of methods used to provide functionality to the website.
Constructs the admin model and connects the database.
Parameters
$database : PDO
Return N/A
Retrieve customer details by email.
*Parameters
-
$email : string- The email of the customer.
Return array<string|int, mixed>|null
- The customer details or null if not found.
Retrieve customer details by UID.
*Parameters
-
$customerID : int- The unique identifier of the customer.
Return array<string|int, mixed>|null
- The customer details or null if not found.
Retrieve customer details by username.
Parameters
-
$username : string- The username of the customer.
Return array<string|int, mixed>|null
- The customer details or null if not found.
Register a new user.
Parameters
-
$userData : array<string|int, mixed>- The user data including email, username, address, and password hash.
Return array<string|int, mixed>|null
- The registered customer details or null if registration fails.
Update a customer's details.
Parameters
-
$UID : int- The unique identifier of the customer.
-
$field : string- The field to update.
-
$value : string- The new value.
Return bool
- True if the update is successful, false otherwise.
Customer constructor.
Parameters
-
$customerData : array- The customer details.
Return N/A
Get the customer's unique identifier.
Parameters N/A
Return int
- The customer's unique identifier
Set the customer's unique identifier.
Parameters
-
$UID : int- The customer's unique identifier
Returns N/A
Retrieve the customer's email.
Parameters N/A
Return string
- The customer's email.
Set the customer's email.
Parameters
-
$email : string- The customer's email.
Get the customer's username.
Parameters N/A
Returns string
- The customer's username.
Set the customer's username.
Parameters
-
$username : string- The customer's username.
Returns N/A
Retrieve the customer's address.
Parameters N/A
Return string
- The customer's address.
Set the customer's address.
Parameters
-
$address : string- The customer's address.
Return N/A
Get the customer's password hash.
Parameters N/A
Returns string
- The customer's password hash.
Set the customer's password hash.
Parameters
-
$passwordHash : string- The customer's password hash.
Return N/A
Get the customer's creation date.
Parameters N/A
Returns string
- The customer's creation date.
Retrieve the customer's last update date.
Parameters N/A
Return string
- The customer's last update date.