tab_systemmessages
in package
Class tab_systemmessages Represents a system messages table.
Table of Contents
Properties
- $allowedcols : array<string|int, mixed>
- $db : db_master
Methods
- __construct() : mixed
- Constructs a new instance of the class.
- __destruct() : void
- Destructor method for the class.
- all() : false|array<string|int, mixed>
- Retrieves all system messages from the database based on specified value and column.
- delete() : bool
- Löscht eine Zeile aus der `systemmessages`-Tabelle basierend auf einem übergebenen Wert und einer Spalte.
- get() : false|array<string|int, mixed>
- Retrieves rows from the systemmessages table based on a specified column/value pair.
- insert() : bool
- Inserts a new system message into the `systemmessages` table.
- update() : bool
- Updates a value in the systemmessages table based on column, value, and id parameters
Properties
$allowedcols
protected
array<string|int, mixed>
$allowedcols
= ['id', 'created', 'end', 'class', 'title', 'message', 'active']
The list of allowed column names.
$db
protected
db_master
$db
The database connection object.
Methods
__construct()
Constructs a new instance of the class.
public
__construct() : mixed
Initializes the object by assigning the global $dbm variable to the $this->db property.
__destruct()
Destructor method for the class.
public
__destruct() : void
Unsets the value of the "db" property.
all()
Retrieves all system messages from the database based on specified value and column.
public
all([string $val = '' ][, string $col = 'active' ]) : false|array<string|int, mixed>
Parameters
- $val : string = ''
-
(optional) The value to search for in the specified column. Default is empty string.
- $col : string = 'active'
-
(optional) The column to search in. Default is 'active'.
Return values
false|array<string|int, mixed> —Returns an array of system messages if found, otherwise returns false.
delete()
Löscht eine Zeile aus der `systemmessages`-Tabelle basierend auf einem übergebenen Wert und einer Spalte.
public
delete(string $val[, string $col = 'id' ]) : bool
Wenn die Zeile erfolgreich gelöscht wird, wird True zurückgegeben, andernfalls wird False zurückgegeben.
Parameters
- $val : string
-
- Der Wert, anhand dessen die Zeile gelöscht werden soll.
- $col : string = 'id'
-
- Die Spalte, in der nach dem Wert gesucht werden soll. Standardwert: 'id'.
Return values
bool —- True, wenn die Zeile erfolgreich gelöscht wird, andernfalls False.
get()
Retrieves rows from the systemmessages table based on a specified column/value pair.
public
get(string $val[, string $col = 'id' ]) : false|array<string|int, mixed>
If the specified column is not allowed, the default column 'id' will be used.
Parameters
- $val : string
-
The value to search for in the specified column
- $col : string = 'id'
-
(optional) The column to search in (default: 'id')
Return values
false|array<string|int, mixed> —Returns an array of rows if the query is successful, otherwise returns False
insert()
Inserts a new system message into the `systemmessages` table.
public
insert(string $end, string $class, string $title, string $message, string $active) : bool
Parameters
- $end : string
-
The end date of the message.
- $class : string
-
The css-class of the message.
- $title : string
-
The title of the message.
- $message : string
-
The content of the message.
- $active : string
-
The active status of the message.
Return values
bool —Returns true if the insertion is successful, false otherwise.
update()
Updates a value in the systemmessages table based on column, value, and id parameters
public
update(string $col, string $val, string $id) : bool
Parameters
- $col : string
-
The column name in which to update the value
- $val : string
-
The new value to be updated
- $id : string
-
The id of the row to be updated
Return values
bool —True if the update was successful, otherwise false