1 | <?php |
||
15 | class TableFactory |
||
16 | { |
||
17 | /** |
||
18 | * Array of default models classes |
||
19 | * @var array |
||
20 | */ |
||
21 | protected static $defaultModelClasses = [ |
||
22 | 'Users' => UsersTable::class, |
||
23 | 'Roles' => RolesTable::class, |
||
24 | 'Permissions' => PermissionsTable::class |
||
25 | ]; |
||
26 | |||
27 | /** |
||
28 | * Gets the role model |
||
29 | * @return Table |
||
30 | */ |
||
31 | public static function getRoleModel() |
||
35 | |||
36 | /** |
||
37 | * Gets the permission model |
||
38 | * @return Table |
||
39 | */ |
||
40 | public static function getPermissionModel() |
||
44 | |||
45 | /** |
||
46 | * Gets the user model |
||
47 | * @return Table |
||
48 | */ |
||
49 | public static function getUserModel() |
||
53 | |||
54 | /** |
||
55 | * Gets the model instance |
||
56 | * @param $name |
||
57 | * @return Table |
||
58 | */ |
||
59 | public static function getModel($name) |
||
65 | |||
66 | /** |
||
67 | * Gets the default model class |
||
68 | * @param string $name |
||
69 | * @return string |
||
70 | */ |
||
71 | public static function getModelClass($name) |
||
75 | } |