Lines
100.00%
3 / 3
Methods
100.00%
3 / 3
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| findByOwner | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| has | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| 15 | class AgentStatRepository extends ServiceEntityRepository | |
| 16 | { | |
| 17 | public function __construct(ManagerRegistry $registry) | |
| 18 | { | |
| 19 | parent::__construct($registry, AgentStat::class); | |
| 20 | } | |
| 21 | ||
| 22 | /** | |
| 23 | * @return AgentStat[] | |
| 24 | */ | |
| 25 | public function findByOwner(User $owner): array | |
| 26 | { | |
| 27 | return $this->findBy(['owner' => $owner], ['datetime' => 'DESC', 'id' => 'DESC']); | |
| 28 | } | |
| 29 | ||
| 30 | public function has(User $owner, \DateTimeImmutable $datetime): bool | |
| 31 | { | |
| 32 | return null !== $this->findOneBy(['owner' => $owner, 'datetime' => $datetime]); | |
| 33 | } | |
| 34 | } |