您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

28 行
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. }