Create a singleton method called new

This commit is contained in:
FusionPBX 2024-11-27 00:11:58 -07:00 committed by GitHub
parent 5757f2c9ee
commit 3a14a19800
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -35,6 +35,7 @@ if (!class_exists('permissions')) {
private $user_uuid;
private $groups;
private $permissions;
private static $permission;
/**
* called when the object is created
@ -194,6 +195,16 @@ if (!class_exists('permissions')) {
}
}
/**
* Returns a new permission object
*/
public static function new($database, $domain_uuid, $user_uuid) {
if (self::$permission === null) {
self::$permission = new permissions($database, $domain_uuid, $user_uuid);
}
return self::$permission;
}
}
}