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.

34 lines
827B

  1. <?php
  2. namespace common\logic\User\UserUserGroup\Repository;
  3. use common\logic\AbstractRepository;
  4. use common\logic\User\User\Model\User;
  5. use common\logic\User\UserUserGroup\Model\UserUserGroup;
  6. class UserUserGroupRepository extends AbstractRepository
  7. {
  8. protected UserUserGroupRepositoryQuery $query;
  9. public function loadDependencies(): void
  10. {
  11. $this->query = $this->loadService(UserUserGroupRepositoryQuery::class);
  12. }
  13. public function getDefaultOptionsSearch(): array
  14. {
  15. return [
  16. 'with' => [],
  17. 'join_with' => [],
  18. 'orderby' => '',
  19. 'attribute_id_producer' => ''
  20. ] ;
  21. }
  22. public function findUserUserGroupsByUser(User $user)
  23. {
  24. return UserUserGroup::searchAll([
  25. 'id_user' => $user->id
  26. ]);
  27. }
  28. }