Documentation

main

Class main

Represents the main class of the tenants.

Table of Contents

Properties

$ttenants  : tab_tenants
$ttenantsappointments  : tab_tenants_appointments
$ttenantscredentials  : tab_tenants_credentials
$ttenantsdetails  : tab_tenants_details
$ttenantslogos  : tab_tenants_logos

Methods

__construct()  : mixed
Constructor for the given class.
__destruct()  : void
Destructor method to unset objects.
all()  : array<string|int, mixed>|bool
Retrieves all records from the ttenants object.
appointmentsdelete()  : bool
Deletes appointments information from the ttenantsappointments object.
appointmentsget()  : array<string|int, mixed>|bool
Retrieves appointments information from the ttenantsappointments object.
appointmentsinsert()  : string|bool
Inserts an appointment into the ttenantsappointments object.
appointmentsupdate()  : bool
Updates an appointment in the ttenantsappointments object.
checkdb()  : bool
Checks the consistency of the ttenants database.
credall()  : array<string|int, mixed>|bool
Retrieves all credentials based on tenants ID.
creddelete()  : bool
Deletes a credential based on the given value and column.
credget()  : array<string|int, mixed>|bool
Retrieves credentials based on the given tenant ID and type.
credinsert()  : string|bool
Inserts credentials into the system for a tenant.
credupdate()  : bool
Updates the credentials for a tenant based on the given tenant ID, type, username, and password.
delete()  : bool
Deletes a record from the ttenants object.
detaildelete()  : bool
Deletes details information from the ttenantsdetails object.
detailinsert()  : string|bool
Inserts detailed information into the ttenantsdetails object.
detailsget()  : array<string|int, mixed>|bool
Retrieves details information from the ttenantsdetails object.
detailupdate()  : bool
Updates the details information in the ttenantsdetails object.
dropdatabase()  : bool
Drops a database based on the given tenant ID and database name.
get()  : array<string|int, mixed>|bool
Retrieve data from the ttenants table based on the given value and column.
getcomparedb()  : string
Retrieves database comparison information for a given name.
insert()  : string|bool
Inserts a new record into the ttenants object.
logosdelete()  : bool
Deletes a logo based on the given value and column.
logosget()  : array<string|int, mixed>|bool
Retrieves logos information from the ttenantslogos object.
logosinsert()  : string|bool
Inserts a logo into the ttenantslogos object.
logosupdate()  : bool
Updates the logo information in the ttenantslogos object.
update()  : bool
Updates a record in the database based on the given column, value, and ID.
uploadimage()  : string|bool
Uploads an image for a tenant.

Properties

Methods

__construct()

Constructor for the given class.

public __construct() : mixed

Initializes the following properties:

  • ttenants: An instance of the tab_tenants class.
  • ttenantsdetails: An instance of the tab_tenants_details class.
  • ttenantsappointments: An instance of the tab_tenants_appointments class.
  • ttenantslogos: An instance of the tab_tenants_logos class.
  • ttenantscredentials: An instance of the tab_tenants_credentials class.

__destruct()

Destructor method to unset objects.

public __destruct() : void

This method unsets the following objects:

  • $this->ttenants
  • $this->ttenantsdetails
  • $this->ttenantsappointments
  • $this->ttenantslogos
  • $this->ttenantscredentials

all()

Retrieves all records from the ttenants object.

public all([string $col = 'id' ][, string $sort = 'ASC' ]) : array<string|int, mixed>|bool
Parameters
$col : string = 'id'

The column to sort by. Defaults to 'id'.

$sort : string = 'ASC'

The sort order. Defaults to 'ASC'.

Return values
array<string|int, mixed>|bool

Returns an array containing all the records if found, otherwise returns false.

appointmentsdelete()

Deletes appointments information from the ttenantsappointments object.

public appointmentsdelete(string $val[, string $col = 'tenant' ]) : bool
Parameters
$val : string

The value to delete.

$col : string = 'tenant'

The column to search in. Defaults to 'tenant'.

Return values
bool

Returns true if the appointments information is successfully deleted, otherwise returns false.

appointmentsget()

Retrieves appointments information from the ttenantsappointments object.

public appointmentsget(string $val[, string $col = 'tenant' ]) : array<string|int, mixed>|bool
Parameters
$val : string

The value to search for.

$col : string = 'tenant'

The column to search in. Defaults to 'tenant'.

Return values
array<string|int, mixed>|bool

Returns an array containing the appointments information if found, otherwise returns false.

appointmentsinsert()

Inserts an appointment into the ttenantsappointments object.

public appointmentsinsert(string $tid, string $active, string $username, string $password[, string $calname = '' ]) : string|bool
Parameters
$tid : string

The tenant ID.

$active : string

The activity status of the appointment.

$username : string

The username associated with the appointment.

$password : string

The password associated with the appointment.

$calname : string = ''

The calendar name. Defaults to an empty string.

Return values
string|bool

Returns a string representing the inserted appointment ID if successful, otherwise returns false.

appointmentsupdate()

Updates an appointment in the ttenantsappointments object.

public appointmentsupdate(string $col, string $val, string $id) : bool
Parameters
$col : string

The column to update.

$val : string

The new value for the column.

$id : string

The id of the appointment to update.

Return values
bool

Returns true if the appointment is successfully updated, otherwise returns false.

checkdb()

Checks the consistency of the ttenants database.

public checkdb(string $name) : bool
Parameters
$name : string

The name to check in the ttenants database.

Return values
bool

Returns true if the name is consistent in the database, otherwise returns false.

credall()

Retrieves all credentials based on tenants ID.

public credall(string $tid) : array<string|int, mixed>|bool
Parameters
$tid : string

The ID of the tenant for whom to retrieve the credentials.

Return values
array<string|int, mixed>|bool

Returns an array of credentials if found, false otherwise.

creddelete()

Deletes a credential based on the given value and column.

public creddelete(string $val[, string $col = 'tenant' ]) : bool
Parameters
$val : string

The value of the credential to be deleted.

$col : string = 'tenant'

[Optional] The column in which to search for the credential. Default is 'tenant'.

Return values
bool

Returns true if the credential was successfully deleted, false otherwise.

credget()

Retrieves credentials based on the given tenant ID and type.

public credget(string $tid, string $type) : array<string|int, mixed>|bool
Parameters
$tid : string

The ID of the tenant.

$type : string

The type of credentials to retrieve.

Return values
array<string|int, mixed>|bool

Returns an array of credentials if found, false otherwise.

credinsert()

Inserts credentials into the system for a tenant.

public credinsert(string $tid, string $type, string $user, string $pass) : string|bool
Parameters
$tid : string

The ID of the tenant.

$type : string

The type of credentials.

$user : string

The username for the credentials.

$pass : string

The password for the credentials.

Return values
string|bool

Returns the ID of the inserted credentials if successful, false otherwise.

credupdate()

Updates the credentials for a tenant based on the given tenant ID, type, username, and password.

public credupdate(string $tid, string $type, string $user, string $pass) : bool
Parameters
$tid : string

The ID of the tenant for which to update the credentials.

$type : string

The type of credentials to update (e.g., "FTP", "API").

$user : string

The new username for the credentials.

$pass : string

The new password for the credentials.

Return values
bool

Returns true if the credentials were successfully updated, false otherwise.

delete()

Deletes a record from the ttenants object.

public delete(string $val[, string $col = 'id' ]) : bool
Parameters
$val : string

The value to search for.

$col : string = 'id'

The column to search in. Defaults to 'id'.

Return values
bool

Returns true if the record is successfully deleted, otherwise returns false.

detaildelete()

Deletes details information from the ttenantsdetails object.

public detaildelete(string $val[, string $col = 'tenant' ]) : bool
Parameters
$val : string

The value to search for.

$col : string = 'tenant'

The column to search in. Defaults to 'tenant'.

Return values
bool

Returns true if the details information is deleted successfully, otherwise returns false.

detailinsert()

Inserts detailed information into the ttenantsdetails object.

public detailinsert(string $tid, string $street, string $zip, string $city, string $phone, string $fax, string $web, string $email, string $remail, string $bank, string $iban, string $bic, string $ceo, string $ag, string $taxid, string $ustid[, string $work = '' ][, string $workae = '0' ][, string $approach = '' ][, string $approach_outside = '' ]) : string|bool
Parameters
$tid : string

The tenant ID.

$street : string

The street address.

$zip : string

The ZIP code.

$city : string

The city.

$phone : string

The phone number.

$fax : string

The fax number.

$web : string

The website URL.

$email : string

The primary email.

$remail : string

The secondary email.

$bank : string

The bank name.

$iban : string

The IBAN number.

$bic : string

The BIC number.

$ceo : string

The CEO name.

$ag : string

The AG name.

$taxid : string

The tax ID.

$ustid : string

The UST ID.

$work : string = ''

Additional work article number. Defaults to an empty string.

$workae : string = '0'

Additional work with work units instead of hourly billing. Defaults to a string with 0

$approach : string = ''

The approach article number. Defaults to an empty string.

$approach_outside : string = ''

The outside approach article number. Defaults to an empty string.

Return values
string|bool

Returns a string indicating a successful insertion, or false if an error occurs.

detailsget()

Retrieves details information from the ttenantsdetails object.

public detailsget(string $val[, string $col = 'tenant' ]) : array<string|int, mixed>|bool
Parameters
$val : string

The value to search for.

$col : string = 'tenant'

The column to search in. Defaults to 'tenant'.

Return values
array<string|int, mixed>|bool

Returns an array containing the details information if found, otherwise returns false.

detailupdate()

Updates the details information in the ttenantsdetails object.

public detailupdate(string $col, string $val, string $id) : bool
Parameters
$col : string

The column name to update.

$val : string

The new value to update.

$id : string

The identifier of the details information to update.

Return values
bool

Returns true if the update is successful, otherwise returns false.

dropdatabase()

Drops a database based on the given tenant ID and database name.

public dropdatabase(string $tid, string $dbname) : bool
Parameters
$tid : string

The tenant ID.

$dbname : string

The name of the database to be dropped.

Return values
bool

Returns true if the database was successfully dropped, false otherwise.

get()

Retrieve data from the ttenants table based on the given value and column.

public get(string $val[, string $col = 'id' ]) : array<string|int, mixed>|bool
Parameters
$val : string

The value to search for.

$col : string = 'id'

The column to search in. Default is 'id'.

Return values
array<string|int, mixed>|bool

Returns an array containing the retrieved data, or false if no data is found.

getcomparedb()

Retrieves database comparison information for a given name.

public getcomparedb(string $name) : string
Parameters
$name : string

The name of the database to compare.

Return values
string

Returns a string with the comparison information. If the database is not found, returns 'Datenbank ist nicht vorhanden'. If any table is not found in the comparison information, returns 'Eine Tabelle nicht vorhanden'. Otherwise, returns the debug output of the comparison information.

insert()

Inserts a new record into the ttenants object.

public insert(string $name, string $database) : string|bool
Parameters
$name : string

The name of the record to insert.

$database : string

The database to insert the record into.

Return values
string|bool

Returns the inserted record if successful, otherwise returns false.

logosdelete()

Deletes a logo based on the given value and column.

public logosdelete(string $val[, string $col = 'tenant' ]) : bool
Parameters
$val : string

The value of the logo to be deleted.

$col : string = 'tenant'

[Optional] The column in which to search for the logo. Default is 'tenant'.

Return values
bool

Returns true if the logo was successfully deleted, false otherwise.

logosget()

Retrieves logos information from the ttenantslogos object.

public logosget(string $tid, string $type) : array<string|int, mixed>|bool
Parameters
$tid : string

The tenant ID.

$type : string

The type of the logo.

Return values
array<string|int, mixed>|bool

Returns an array containing the logos information if found, otherwise returns false.

logosinsert()

Inserts a logo into the ttenantslogos object.

public logosinsert(string $tid, string $type, string $filename) : string|bool
Parameters
$tid : string

The tenant ID to associate with the logo.

$type : string

The type of the logo (1 = Website, 2 = Briefkopf).

$filename : string

The filename of the logo.

Return values
string|bool

Returns the inserted logo's ID if successful, otherwise returns false.

logosupdate()

Updates the logo information in the ttenantslogos object.

public logosupdate(string $filename, string $tid, string $type) : bool
Parameters
$filename : string

The new filename for the logo.

$tid : string

The ID of the tenant whose logo is being updated.

$type : string

The type of the logo being updated.

Return values
bool

Returns true if the logo information is updated successfully, otherwise returns false.

update()

Updates a record in the database based on the given column, value, and ID.

public update(string $col, string $val, string $id) : bool
Parameters
$col : string

The column to be updated.

$val : string

The new value to be set.

$id : string

The ID of the record to be updated.

Return values
bool

Returns true if the record was successfully updated, false otherwise.

uploadimage()

Uploads an image for a tenant.

public uploadimage(string $tid, string $type, string $name) : string|bool
Parameters
$tid : string

The ID of the tenant.

$type : string

The type of the image.

$name : string

The name of the image file to be uploaded.

Return values
string|bool

Returns the id of the uploaded image if successful, otherwise returns false.


        
On this page

Search results