PluginProbe
User Access Manager / 2.3.7
User Access Manager v2.3.7
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
user-access-manager / src / UserGroup / UserGroupFactory.php

UserGroupFactory.php in User Access Manager 2.3.7, at src/UserGroup/UserGroupFactory.php

62 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace UserAccessManager\UserGroup;
6
7 use UserAccessManager\Config\MainConfig;
8 use UserAccessManager\Database\Database;
9 use UserAccessManager\Object\ObjectHandler;
10 use UserAccessManager\Util\Util;
11 use UserAccessManager\Wrapper\Php;
12 use UserAccessManager\Wrapper\Wordpress;
13
14 class UserGroupFactory
15 {
16 public function __construct(
17 private Php $php,
18 private Wordpress $wordpress,
19 private Database $database,
20 private MainConfig $config,
21 private Util $util,
22 private ObjectHandler $objectHandler,
23 private AssignmentInformationFactory $assignmentInformationFactory
24 ) {
25 }
26
27 /**
28 * @throws UserGroupTypeException
29 */
30 public function createUserGroup(int|string|null $id = null): UserGroup
31 {
32 return new UserGroup(
33 $this->php,
34 $this->wordpress,
35 $this->database,
36 $this->config,
37 $this->util,
38 $this->objectHandler,
39 $this->assignmentInformationFactory,
40 $id
41 );
42 }
43
44 /**
45 * @throws UserGroupTypeException
46 */
47 public function createDynamicUserGroup(string $type, int|string $id): DynamicUserGroup
48 {
49 return new DynamicUserGroup(
50 $this->php,
51 $this->wordpress,
52 $this->database,
53 $this->config,
54 $this->util,
55 $this->objectHandler,
56 $this->assignmentInformationFactory,
57 $type,
58 $id
59 );
60 }
61 }
62