選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

UserProducerSolver.php 995B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace domain\User\UserProducer;
  3. use domain\_\AbstractSolver;
  4. class UserProducerSolver extends AbstractSolver
  5. {
  6. public function hasOutstandingCredit(UserProducer $userProducer): bool
  7. {
  8. return $userProducer->credit < 0 || $userProducer->credit > 0;
  9. }
  10. public function filterPointsSaleByExclusiveAccess(UserProducer $userProducer, array $pointsSaleArray = []): array
  11. {
  12. if(!$userProducer->getExclusiveAccessSelectedPointsSale()) {
  13. return $pointsSaleArray;
  14. }
  15. $filteredPointsSaleArray = [];
  16. foreach($pointsSaleArray as $pointSale) {
  17. $idPointSale = is_array($pointSale) ? $pointSale['id'] : $pointSale->id;
  18. foreach($userProducer->user->userPointSale as $userPointSale) {
  19. if($idPointSale == $userPointSale->pointSale->id) {
  20. $filteredPointsSaleArray[] = $pointSale;
  21. }
  22. }
  23. }
  24. return $filteredPointsSaleArray;
  25. }
  26. }