AttemptsRepository.php 977 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
<?php


namespace Source\Gateways\Attempts;

use Carbon\Carbon;
use Source\Entities\Attempt;

interface AttemptsRepository
{
    /**
     * @param \Source\Entities\Attempt $attempt
Jacob Priddy's avatar
Jacob Priddy committed
13
     * @return \Source\Entities\Attempt|null
14
     */
Jacob Priddy's avatar
Jacob Priddy committed
15
    public function add(Attempt $attempt): ?Attempt;
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

    /**
     * @param \Carbon\Carbon $begin
     * @param \Carbon\Carbon $end
     * @return \Source\Entities\Attempt[]
     */
    public function getBetween(Carbon $begin, Carbon $end): array;

    /**
     * @param string         $doorId
     * @param \Carbon\Carbon $begin
     * @param \Carbon\Carbon $end
     * @return \Source\Entities\Attempt[]
     */
    public function getForDoorBetween(string $doorId, Carbon $begin, Carbon $end): array;

    /**
     * @param string         $doorId
     * @param \Carbon\Carbon $begin
     * @param \Carbon\Carbon $end
     * @return int
     */
    public function getCountForDoorBetween(string $doorId, Carbon $begin, Carbon $end): int;
}