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.

38 lines
1.1 KiB

5 years ago
5 years ago
  1. <?php
  2. namespace App\Service\v3\Implementations;
  3. use App\Model\v3\UserRelationBind;
  4. use App\Service\v3\Interfaces\UserRelationBindServiceInterface;
  5. class UserCommunityBindService implements UserRelationBindServiceInterface
  6. {
  7. /**
  8. * @inheritDoc
  9. */
  10. public function bindLimitByUser($bind_type, $source_id, $user_id, $extra_data)
  11. {
  12. return UserRelationBind::query()->updateOrCreate(
  13. ['bind_type' => $bind_type, 'user_id' => $user_id],
  14. ['source_id' => $source_id, 'json_data' => $extra_data]
  15. );
  16. }
  17. public function bindLimitBySource($bind_type, $source_id, $user_id, $extra_data)
  18. {
  19. // TODO: Implement bindLimitBySource() method.
  20. }
  21. public function bind($bind_type, $source_id, $user_id, $extra_data)
  22. {
  23. return UserRelationBind::query()->firstOrCreate(
  24. ['bind_type' => $bind_type, 'user_id' => $user_id],
  25. ['source_id' => $source_id, 'json_data' => $extra_data]
  26. );
  27. }
  28. public function isBinded($bind_type, $source_id, $user_id)
  29. {
  30. // TODO: Implement isBinded() method.
  31. }
  32. }