| @@ -6,18 +6,22 @@ | ||
| 6 | 6 | |
| 7 | 7 | use UserAccessManager\Config\MainConfig; |
| 8 | 8 | use UserAccessManager\Database\Database; |
| 9 | 9 | use UserAccessManager\Object\ObjectHandler; |
| 10 | +use UserAccessManager\Util\Util; | |
| 11 | +use UserAccessManager\Wrapper\Php; | |
| 10 | 12 | use UserAccessManager\Wrapper\Wordpress; |
| 11 | 13 | |
| 12 | 14 | class UserGroupFactory |
| 13 | 15 | { |
| 14 | 16 | public function __construct( |
| 17 | + private Php $php, | |
| 15 | 18 | private Wordpress $wordpress, |
| 16 | 19 | private Database $database, |
| 17 | 20 | private MainConfig $config, |
| 21 | + private Util $util, | |
| 18 | 22 | private ObjectHandler $objectHandler, |
| 19 | - private AssignedObjectsLoader $assignedObjectsLoader | |
| 23 | + private AssignmentInformationFactory $assignmentInformationFactory | |
| 20 | 24 | ) { |
| 21 | 25 | } |
| 22 | 26 | |
| 23 | 27 | /** |
| @@ -25,13 +29,15 @@ | ||
| 25 | 29 | */ |
| 26 | 30 | public function createUserGroup(int|string|null $id = null): UserGroup |
| 27 | 31 | { |
| 28 | 32 | return new UserGroup( |
| 33 | + $this->php, | |
| 29 | 34 | $this->wordpress, |
| 30 | 35 | $this->database, |
| 31 | 36 | $this->config, |
| 37 | + $this->util, | |
| 32 | 38 | $this->objectHandler, |
| 33 | - $this->assignedObjectsLoader, | |
| 39 | + $this->assignmentInformationFactory, | |
| 34 | 40 | $id |
| 35 | 41 | ); |
| 36 | 42 | } |
| 37 | 43 | |
| @@ -37,27 +43,18 @@ | ||
| 37 | 43 | |
| 38 | 44 | /** |
| 39 | 45 | * @throws UserGroupTypeException |
| 40 | 46 | */ |
| 41 | - public function createUserGroupFromDatabaseRow(object $databaseUserGroup): UserGroup | |
| 42 | - { | |
| 43 | - $userGroup = $this->createUserGroup(); | |
| 44 | - $userGroup->assignDatabaseValues($databaseUserGroup); | |
| 45 | - | |
| 46 | - return $userGroup; | |
| 47 | - } | |
| 48 | - | |
| 49 | - /** | |
| 50 | - * @throws UserGroupTypeException | |
| 51 | - */ | |
| 52 | 47 | public function createDynamicUserGroup(string $type, int|string $id): DynamicUserGroup |
| 53 | 48 | { |
| 54 | 49 | return new DynamicUserGroup( |
| 50 | + $this->php, | |
| 55 | 51 | $this->wordpress, |
| 56 | 52 | $this->database, |
| 57 | 53 | $this->config, |
| 54 | + $this->util, | |
| 58 | 55 | $this->objectHandler, |
| 59 | - $this->assignedObjectsLoader, | |
| 56 | + $this->assignmentInformationFactory, | |
| 60 | 57 | $type, |
| 61 | 58 | $id |
| 62 | 59 | ); |
| 63 | 60 | } |