mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Move database methods to static and document database class (#6474)
* Add new static method to created newly connected database object * Document database class and clean up and document some of the methods. This removes the methods that should not be in each instance and places them in the single instance class as to occupy less resources and be able to create database objects more efficiently. * More docs & removed the ability to set any value within the object. Co-authored-by: Tim Fry <tim@voipstratus.com>
This commit is contained in:
@@ -73,6 +73,7 @@ if (!class_exists('user_logs')) {
|
||||
* add user_logs
|
||||
*/
|
||||
public static function add($result) {
|
||||
$array = [];
|
||||
//prepare the array
|
||||
$array['user_logs'][0]["timestamp"] = 'now()';
|
||||
$array['user_logs'][0]["domain_uuid"] = $result['domain_uuid'];
|
||||
@@ -97,7 +98,8 @@ if (!class_exists('user_logs')) {
|
||||
$database = new database;
|
||||
$database->app_name = 'authentication';
|
||||
$database->app_uuid = 'a8a12918-69a4-4ece-a1ae-3932be0e41f1';
|
||||
$database->uuid($user_log_uuid);
|
||||
if (strlen($user_log_uuid)>0)
|
||||
$database->uuid($user_log_uuid);
|
||||
$database->save($array, false);
|
||||
$message = $database->message;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user