1 | <?php |
||
15 | class Helper |
||
16 | { |
||
17 | /** |
||
18 | * Check user model for be implemented by RbacUserInterface and extended of parent Auth User model. |
||
19 | * @param string|null $userModelClass |
||
20 | * @throws \Exception |
||
21 | */ |
||
22 | public static function checkUserModel(string $userModelClass = null) |
||
32 | |||
33 | /** |
||
34 | * Check user model for be implemented by RbacUserInterface. |
||
35 | * @param string $userModelClass |
||
36 | * @param string $interfaceClass |
||
37 | * @throws \Exception |
||
38 | */ |
||
39 | public static function checkUserModelInterface(string $userModelClass, string $interfaceClass): void |
||
47 | |||
48 | /** |
||
49 | * Check user model for instance of parent Auth User model. |
||
50 | * @param string $userModelClass |
||
51 | * @param string $parentClass |
||
52 | * @throws \Exception |
||
53 | */ |
||
54 | public static function checkUserModelParent(string $userModelClass, string $parentClass): void |
||
62 | |||
63 | /** |
||
64 | * Check a primary key type of a User model. |
||
65 | * @param ParentUser $userModelObject |
||
66 | * @throws \Exception |
||
67 | */ |
||
68 | public static function checkUserModelKeyType(ParentUser $userModelObject): void |
||
74 | |||
75 | /** |
||
76 | * Check a primary key type of a users table. |
||
77 | * @param string $userTablePrimaryType |
||
78 | * @param string $userModelKeyName |
||
79 | * @param string $userModelTable |
||
80 | * @throws \Exception |
||
81 | */ |
||
82 | public static function checkUserTablePrimaryType(string $userTablePrimaryType, string $userModelKeyName, string $userModelTable): void |
||
88 | |||
89 | /** |
||
90 | * Check for correct defining of an Admin user ID value at the beginning package installation. |
||
91 | * @param int|null $adminUserId |
||
92 | * @throws \Exception |
||
93 | */ |
||
94 | public static function checkAdminUserId(int $adminUserId = null): void |
||
100 | |||
101 | /** |
||
102 | * Retrieve user model entity. |
||
103 | * @param string $userModelClass |
||
104 | * @param int $adminUserId |
||
105 | * @return mixed |
||
106 | * @throws \Exception |
||
107 | */ |
||
108 | public static function retrieveUserModel(string $userModelClass, int $adminUserId) |
||
115 | } |
||
116 |