You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
827B

  1. <?php
  2. namespace common\logic\User\UserUserGroup\Service;
  3. use common\logic\AbstractBuilder;
  4. use common\logic\User\User\Model\User;
  5. use common\logic\User\UserGroup\Model\UserGroup;
  6. use common\logic\User\UserUserGroup\Model\UserUserGroup;
  7. class UserUserGroupBuilder extends AbstractBuilder
  8. {
  9. public function instanciateUserUserGroup(User $user, UserGroup $userGroup): UserUserGroup
  10. {
  11. $userUserGroup = new UserUserGroup();
  12. $userUserGroup->populateUser($user);
  13. $userUserGroup->populateUserGroup($userGroup);
  14. return $userUserGroup;
  15. }
  16. public function createUserUserGroup(User $user, UserGroup $userGroup): UserUserGroup
  17. {
  18. $userUserGroup = $this->instanciateUserUserGroup($user, $userGroup);
  19. $this->create($userUserGroup);
  20. return $userUserGroup;
  21. }
  22. }