maillog
in package
This class represents a mail log, which is used to manage email logs.
Class maillog
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructor for the class.
- __destruct() : void
- Perform cleanup tasks before the object is destroyed.
- all() : array<string|int, mixed>|bool
- Retrieve all TMail logs.
- clear() : bool
- Clears all entries in the Tmaillogs table.
- count() : int|string
- Count the number of records in the tmaillogs table based on given value and column.
- delete() : bool
- Deletes an entry in the Tmaillogs table based on a specified value and column.
- get() : array<string|int, mixed>|bool
- Retrieve TMail logs based on a specified value and column.
- insert() : bool
- Insert a new record into the tmaillogs table.
- update() : bool
- Updates a record in the Tmaillogs table.
Properties
$tmaillogs
protected
tab_maillogs
$tmaillogs
This variable holds an object of email logs.
Methods
__construct()
Constructor for the class.
public
__construct() : mixed
Initializes a new instance of the class and sets the 'tmaillogs' property as a new instance of the 'tab_maillogs' class.
__destruct()
Perform cleanup tasks before the object is destroyed.
public
__destruct() : void
all()
Retrieve all TMail logs.
public
all([string $sort = 'stamp' ]) : array<string|int, mixed>|bool
Parameters
- $sort : string = 'stamp'
-
(Optional) The sorting parameter. Defaults to 'stamp'.
Return values
array<string|int, mixed>|bool —Returns an array of TMail logs if successful, or false otherwise.
clear()
Clears all entries in the Tmaillogs table.
public
clear() : bool
Return values
bool —Returns true if all entries are successfully deleted, or false if an error occurred.
count()
Count the number of records in the tmaillogs table based on given value and column.
public
count([string $val = '' ][, string $col = 'id' ]) : int|string
Parameters
- $val : string = ''
-
The value used to filter the records. Default is an empty string, which means count all records.
- $col : string = 'id'
-
The column name to filter the records. Default is 'id'.
Return values
int|string —The number of records that match the given value and column. Returns an integer if the count is numeric, otherwise returns a string '0'.
delete()
Deletes an entry in the Tmaillogs table based on a specified value and column.
public
delete(string $val[, string $col = 'id' ]) : bool
Parameters
- $val : string
-
The value to search for in the specified column.
- $col : string = 'id'
-
The column name to search in. Defaults to 'id'.
Return values
bool —Returns true if the entry is successfully deleted, or false if an error occurred.
get()
Retrieve TMail logs 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'
-
(Optional) The column to search in. Defaults to 'id'.
Return values
array<string|int, mixed>|bool —Returns an array of TMail logs if successful, or false otherwise.
insert()
Insert a new record into the tmaillogs table.
public
insert(string $mailid, string $message, string $debug) : bool
Parameters
- $mailid : string
-
The ID of the email.
- $message : string
-
The content of the email message.
- $debug : string
-
Additional debug information.
Return values
bool —The result of the insert operation. Returns true if the record is successfully inserted, otherwise false.
update()
Updates a record in the Tmaillogs table.
public
update(string $col, string $val, string $id, string $type) : bool
Parameters
- $col : string
-
The column name to update.
- $val : string
-
The new value to set for the specified column.
- $id : string
-
The identifier of the record to be updated.
- $type : string
-
The type of update operation. Possible values can be '0','1', etc.
Return values
bool —Returns true if the record was successfully updated, or false if an error occurred.