main
in package
Class main
Represents a class for managing ticket status records in a database table.
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructor method for initializing the object.
- __destruct() : void
- Destructor method for the class.
- all() : array<string|int, mixed>|bool
- Retrieve all records from the given table.
- delete() : bool
- Deletes a record from the database table.
- get() : array<string|int, mixed>|bool
- Retrieve a record from the given table based on a specified value and column.
- insert() : bool
- Inserts a new ticket status into the database.
- update() : bool
- Updates a record in the database table.
Properties
$tticketsstatus
protected
tab_tickets_status
$tticketsstatus
Represents the tab_tickets_status class.
Methods
__construct()
Constructor method for initializing the object.
public
__construct() : mixed
Instantiates a new instance of the tab_tickets_status class and assigns it to the $tticketsstatus property.
__destruct()
Destructor method for the class.
public
__destruct() : void
This method is automatically called when the object is destroyed or goes out of scope. It is used to clean up any resources or variables used by the object. In this example, it unsets the 'tticketsstatus' property of the object.
all()
Retrieve all records from the given table.
public
all([string $sort = 'id' ][, string $order = 'ASC' ]) : array<string|int, mixed>|bool
Parameters
- $sort : string = 'id'
-
The column to sort the records by. Default is 'id'.
- $order : string = 'ASC'
-
The order in which the records should be sorted. Default is 'ASC'.
Return values
array<string|int, mixed>|bool —An array of records if successful, otherwise false.
delete()
Deletes a record from the database table.
public
delete(string $val[, string $col = 'id' ]) : bool
Parameters
- $val : string
-
The value to match against the specified column.
- $col : string = 'id'
-
Optional. The column to match the value against. Default is 'id'.
Return values
bool —True if the record is successfully deleted, false otherwise.
get()
Retrieve a record from the given table based on a specified value and column.
public
get(string $val[, string $col = 'id' ]) : array<string|int, mixed>|bool
Parameters
- $val : string
-
The value to search for in the specified column.
- $col : string = 'id'
-
The column to search for the specified value. Default is 'id'.
Return values
array<string|int, mixed>|bool —An array representation of the retrieved record if successful, otherwise false.
insert()
Inserts a new ticket status into the database.
public
insert(string $name, string $color, string $icon) : bool
Parameters
- $name : string
-
The name of the ticket status.
- $color : string
-
The color associated with the ticket status.
- $icon : string
-
The icon representing the ticket status.
Return values
bool —True if the insertion is successful, false otherwise.
update()
Updates a record in the database table.
public
update(string $val, string $col, string $id) : bool
Parameters
- $val : string
-
The new value to update the specified column with.
- $col : string
-
The column to update the value in.
- $id : string
-
The identifier of the record to update.
Return values
bool —True if the record is successfully updated, false otherwise.