main
in package
Class Main
Represents the main class for handling work time types.
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructor method.
- __destruct() : void
- Destructor method for the class.
- all() : array<string|int, mixed>|bool
- Retrieves all work time types.
- delete() : bool
- Deletes a record from the database table.
- get() : array<string|int, mixed>|bool
- Retrieves a specific work time type.
- insert() : bool
- Insert a new record into the database.
- update() : bool
- Updates a record in the database table.
Properties
$tworktimetypes
protected
tab_worktime_types
$tworktimetypes
Instance of the 'tab_worktime_types' class.
Methods
__construct()
Constructor method.
public
__construct() : mixed
Initializes the 'tworktimetypes' property with a new instance of the 'tab_worktime_types' class.
__destruct()
Destructor method for the class.
public
__destruct() : void
Unsets the "tworktimetypes" property.
all()
Retrieves all work time types.
public
all([string $sort = 'id' ][, string $order = 'ASC' ]) : array<string|int, mixed>|bool
Parameters
- $sort : string = 'id'
-
The column to sort the work time types by. Default is 'id'.
- $order : string = 'ASC'
-
The order to sort the work time types in. Default is 'ASC'.
Return values
array<string|int, mixed>|bool —An array of work time types if successful, otherwise boolean false.
delete()
Deletes a record from the database table.
public
delete(string $val[, string $col = 'id' ]) : bool
Parameters
- $val : string
-
The value of the column to match for deletion.
- $col : string = 'id'
-
The column name to match for deletion. Defaults to 'id'.
Return values
bool —True if the deletion was successful, false otherwise.
get()
Retrieves a specific work time type.
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 the work time type in. Default is 'id'.
Return values
array<string|int, mixed>|bool —An array representing the work time type if found, otherwise boolean false.
insert()
Insert a new record into the database.
public
insert(string $name) : bool
Parameters
- $name : string
-
The name of the record to insert.
Return values
bool —Returns true if the record is successfully inserted, false otherwise.
update()
Updates a record in the database table.
public
update(string $name, string $id) : bool
Parameters
- $name : string
-
The new name value to update.
- $id : string
-
The identifier of the record to update.
Return values
bool —True if the update was successful, false otherwise.