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.

37 lines
1.0 KiB

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