mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Create a singleton method called new
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user