LocalSchedulesRepository.php 1.02 KB
Newer Older
1
2
3
4
5
<?php


namespace Source\Gateways\Schedules;

Jacob Priddy's avatar
Jacob Priddy committed
6
7
8
9
use Carbon\Carbon;
use Source\Entities\Schedule;
use Source\Gateways\Groups\LocalGroupsRepository;

10
11
class LocalSchedulesRepository extends InMemorySchedulesRepository
{
12
13
14
    /**
     * @throws \Source\Exceptions\EntityNotFoundException
     */
15
    public function __construct()
Jacob Priddy's avatar
Jacob Priddy committed
16
17
18
    {
        $this->create(new Schedule(
            1,
19
            LocalGroupsRepository::getEngineeringLabAccessGroup()->getId(),
Jacob Priddy's avatar
Jacob Priddy committed
20
            Schedule::TYPE_USER_ACCESS,
21
            'RRULE:FREQ=HOURLY;INTERVAL=10',
22
            60,
23
            'Engineering lab user access schedule, every other minute for a minute',
Jacob Priddy's avatar
Jacob Priddy committed
24
25
26
27
            Carbon::now()
        ));

        $this->create(new Schedule(
Jacob Priddy's avatar
Jacob Priddy committed
28
            2,
29
            LocalGroupsRepository::getComputerScienceMajorGroup()->getId(),
Jacob Priddy's avatar
Jacob Priddy committed
30
            Schedule::TYPE_OPEN_MODE,
31
            'RRULE:FREQ=MINUTELY;INTERVAL=50',
32
            60 * 10,
33
            'Computer science lab open mode schedule, every 20 minutes for 10 minutes',
Jacob Priddy's avatar
Jacob Priddy committed
34
35
36
            Carbon::now()
        ));
    }
37
}