mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
refactor naming ReferralsAvailable => referralSuggestion
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\PersonBundle\AccompanyingPeriod\Suggestion;
|
||||
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Repository\UserRepository;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
|
||||
final class ReferralAvailable implements ReferralAvailableInterface
|
||||
{
|
||||
protected UserRepository $userRepository;
|
||||
|
||||
public function __construct(UserRepository $userRepository)
|
||||
{
|
||||
$this->userRepository = $userRepository;
|
||||
}
|
||||
|
||||
public function countReferralAvailable(AccompanyingPeriod $period, ?array $options = []): int
|
||||
{
|
||||
return $this->userRepository->countByActive();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriod $period
|
||||
* @return array|User[]
|
||||
*/
|
||||
public function findReferralAvailable(AccompanyingPeriod $period, int $limit = 50, int $start = 0): array
|
||||
{
|
||||
return $this->userRepository->findByActive();
|
||||
}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\PersonBundle\AccompanyingPeriod\Suggestion;
|
||||
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
|
||||
/**
|
||||
* Basic implementation: this suggestion does not return any suggestion
|
||||
*/
|
||||
final class ReferralsSuggestion implements ReferralsSuggestionInterface
|
||||
{
|
||||
public function countReferralSuggested(AccompanyingPeriod $period, ?array $options = []): int
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriod $period
|
||||
* @return array|User[]
|
||||
*/
|
||||
public function findReferralSuggested(AccompanyingPeriod $period, int $limit = 50, int $start = 0): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
@@ -8,13 +8,13 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
/**
|
||||
* Process the suggestion of referral for a given accompanying period
|
||||
*/
|
||||
interface ReferralAvailableInterface
|
||||
interface ReferralsSuggestionInterface
|
||||
{
|
||||
public function countReferralAvailable(AccompanyingPeriod $period, ?array $options = []): int;
|
||||
public function countReferralSuggested(AccompanyingPeriod $period, ?array $options = []): int;
|
||||
|
||||
/**
|
||||
* @return array|User[]
|
||||
*/
|
||||
public function findReferralAvailable(AccompanyingPeriod $period, int $limit = 50, int $start = 0): array;
|
||||
public function findReferralSuggested(AccompanyingPeriod $period, int $limit = 50, int $start = 0): array;
|
||||
|
||||
}
|
Reference in New Issue
Block a user