tab_tenants_credentials
in package
Table of Contents
Properties
- $allowedcols : array<string|int, mixed>
- $db : db_master
Methods
- __construct() : mixed
- __destruct() : mixed
- all() : array<string|int, mixed>|bool
- Retrieves all records from the `tenants_credentials` table that match the given value.
- delete() : bool
- Deletes records from the `tenants_credentials` table based on the given value and column.
- get() : array<string|int, mixed>|bool
- Retrieves a record from the `tenants_credentials` table that matches the given tenant ID and type.
- insert() : string|bool
- Inserts a new record into the `tenants_credentials` table.
- update() : bool
- Updates the `username` and `password` fields in the `tenants_credentials` table for a specific tenant and type.
Properties
$allowedcols
protected
array<string|int, mixed>
$allowedcols
= ['id', 'tenant', 'type', 'username', 'password']
$db
protected
db_master
$db
Methods
__construct()
public
__construct() : mixed
__destruct()
public
__destruct() : mixed
all()
Retrieves all records from the `tenants_credentials` table that match the given value.
public
all(string $val) : array<string|int, mixed>|bool
Parameters
- $val : string
-
The value to match against the
tenant
column.
Return values
array<string|int, mixed>|bool —Returns an array of records if any are found, or false if no records are found.
delete()
Deletes records from the `tenants_credentials` table based on the given value and column.
public
delete(string $val[, string $col = 'tenant' ]) : bool
Parameters
- $val : string
-
The value to match against the specified column. Default is 'tenant'.
- $col : string = 'tenant'
-
The column to match the value against. Default is 'tenant'.
Return values
bool —Returns true if any records are deleted, false otherwise.
get()
Retrieves a record from the `tenants_credentials` table that matches the given tenant ID and type.
public
get(string $tid, string $type) : array<string|int, mixed>|bool
Parameters
- $tid : string
-
The tenant ID to match against the
tenant
column. - $type : string
-
The type to match against the
type
column.
Return values
array<string|int, mixed>|bool —Returns an array representing the record if found, or false if no record is found.
insert()
Inserts a new record into the `tenants_credentials` table.
public
insert(string $tid, string $type, string $user, string $pass) : string|bool
Parameters
- $tid : string
-
The value of the tid column.
- $type : string
-
The value of the type column.
- $user : string
-
The value of the username column.
- $pass : string
-
The value of the password column.
Return values
string|bool —The ID of the newly inserted record if successful, false otherwise.
update()
Updates the `username` and `password` fields in the `tenants_credentials` table for a specific tenant and type.
public
update(string $user, string $pass, string $tid, string $type) : bool
Parameters
- $user : string
-
The new username value.
- $pass : string
-
The new password value.
- $tid : string
-
The tenant ID to update.
- $type : string
-
The type to update.
Return values
bool —Returns true if the update was successful, false otherwise.