-
Notifications
You must be signed in to change notification settings - Fork 8
Admin.php
- This document provides an overview of the file's structure and functionality.
- Admin.php handles various functionality relating to managing administrator details.
- Admin.php contains a single property
- Admin.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
Adds a new admin to the database
Parameters
-
$adminData : array<string|int, mixed>- The admin details to add inluding username and password.
Return array<string|int, mixed>|null
- The registered admin details or null if registration fails.
Retrieve admin details by UID.
Parameters
-
$adminID : int- The unique identifier of the admin.
Return array<string|int, mixed>|null
- The admin details or null if not found.
Retrieve admin details by username.
Parameters
-
$username : string- The username of the admin.
Return array<string|int, mixed>|null
- The admin details or null if not found.
Update an admin's details.
Parameters
-
$adminID : int- The unique identifier of the admin.
-
$field : string- The field to update.
-
$value : string- The new value.
Return bool
- True if the update was successful, false otherwise.
Admin constructor.
Parameters
-
$adminData : array- The admin details.
Return N/A
Get the admin's unique identifier.
Parameters N/A
Return int
- The admin's unique identifier.
Set the admin's unique identifier.
Parameters
-
$adminID : int- The admin's unique identifier
Returns N/A
Get the admin's username.
Parameters N/A
Returns string
- The admin's username.
Set the admin's username.
Parameters
-
$username : string- The admin username.
Returns N/A
Get the admin's password hash.
Parameters N/A
Returns string
- The admin's password hash.
Set the admin's password hash.
Parameters
-
$passwordHash : string- The admin's password hash.
Return N/A
Get the admin's creation date.
Parameters N/A
Returns string
- The admin's creation date.
Set the admin's creation date.
Parameters
-
$createdAt : string- The admin's creation date.
Get the admin's last update date.
Parameters N/A
Return string
- The admin's last update date.