AdminModel
extends Model
in package
Class AdminModel
- Handles administrative data retrieval
- Specifically manages the aggregation of factory order data for the back-office
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructor.
- find() : mixed
- Finds a specific record by its ID.
- findAll() : array<string|int, mixed>|false
- Retrieves all records from the associated table.
- getFactoryOrdersWithDetails() : array<string|int, mixed>
- Retrieves detailed factory orders including item specifications
- requete() : PDOStatement|false
- Executes a SQL query (prepared or direct).
Properties
$db
protected
Db
$db
Instance of the database connection.
$table
protected
string
$table
The database table associated with the model.
Methods
__construct()
Constructor.
public
__construct() : mixed
Initializes the model and ensures a valid database connection
find()
Finds a specific record by its ID.
public
find(int $id) : mixed
Parameters
- $id : int
-
The record identifier.
Return values
mixed —The record object or false if not found.
findAll()
Retrieves all records from the associated table.
public
findAll() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|false —List of records.
getFactoryOrdersWithDetails()
Retrieves detailed factory orders including item specifications
public
getFactoryOrdersWithDetails() : array<string|int, mixed>
Return values
array<string|int, mixed> —list of orders with joined shape and color data
requete()
Executes a SQL query (prepared or direct).
public
requete(string $sql[, array<string|int, mixed>|null $attributs = null ]) : PDOStatement|false
Parameters
- $sql : string
-
The SQL query string.
- $attributs : array<string|int, mixed>|null = null
-
Optional parameters for prepared statements.
Return values
PDOStatement|false —The result statement.