LocalOverridesRepository.php 1.16 KB
Newer Older
1
2
3
4
5
<?php


namespace Source\Gateways\Overrides;

Jacob Priddy's avatar
Jacob Priddy committed
6
7
8
use Carbon\Carbon;
use Source\Entities\Override;
use Source\Gateways\Doors\LocalDoorsRepository;
9
use Source\Gateways\Users\LocalUsersRepository;
Jacob Priddy's avatar
Jacob Priddy committed
10

11
12
class LocalOverridesRepository extends InMemoryOverridesRepository
{
Jacob Priddy's avatar
Jacob Priddy committed
13
14
    public function __construct()
    {
Jacob Priddy's avatar
Jacob Priddy committed
15
        $date = Carbon::now()->addMinute();
16
        $yesterday = Carbon::now()->subDay();
Jacob Priddy's avatar
Jacob Priddy committed
17
18
        $this->addOverride(new Override(
            1,
19
            'Override amazon door cause idk why just for some reason.',
Jacob Priddy's avatar
Jacob Priddy committed
20
21
22
            LocalUsersRepository::getAdminUser()->getId(),
            LocalDoorsRepository::getAmazonDoor()->getId(),
            Override::TYPE_OPEN,
Jacob Priddy's avatar
Jacob Priddy committed
23
24
            $date,
            $date->clone()->addMinutes(20),
25
26
            $yesterday,
            $yesterday
Jacob Priddy's avatar
Jacob Priddy committed
27
28
29
        ));

        $this->addOverride(new Override(
30
            2,
31
            'No one is allowed in the bat cave!',
Jacob Priddy's avatar
Jacob Priddy committed
32
33
34
            LocalUsersRepository::getAdminUser()->getId(),
            LocalDoorsRepository::getTheBatCave()->getId(),
            Override::TYPE_LOCKED,
35
            $yesterday,
Jacob Priddy's avatar
Jacob Priddy committed
36
            $date->clone()->subHours(15),
37
38
            $yesterday,
            $yesterday
Jacob Priddy's avatar
Jacob Priddy committed
39
40
        ));
    }
41
}