Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
DeliveryExecutionConfig
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
4 / 4
4
100.00% covered (success)
100.00%
1 / 1
 isHomeButtonHidden
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 setHideHomeButton
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isLogoutButtonHidden
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 setHideLogoutButton
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3/**
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; under version 2
7 * of the License (non-upgradable).
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 *
18 * Copyright (c) 2020 (original work) Open Assessment Technologies SA;
19 */
20
21declare(strict_types=1);
22
23namespace oat\taoDelivery\model\execution;
24
25use oat\oatbox\service\ConfigurableService;
26
27class DeliveryExecutionConfig extends ConfigurableService
28{
29    public const SERVICE_ID = 'taoDelivery/deliveryExecutionConfig';
30
31    public const OPTION_HIDE_HOME_BUTTON = 'hideHomeButton';
32    public const OPTION_HIDE_LOGOUT_BUTTON = 'hideLogoutButton';
33
34    /**
35     * @return bool
36     */
37    public function isHomeButtonHidden(): bool
38    {
39        return filter_var(
40            $this->getOption(self::OPTION_HIDE_HOME_BUTTON, false),
41            FILTER_VALIDATE_BOOLEAN
42        );
43    }
44
45    /**
46     * @param bool $hide
47     */
48    public function setHideHomeButton(bool $hide): void
49    {
50        $this->setOption(self::OPTION_HIDE_HOME_BUTTON, $hide);
51    }
52
53    /**
54     * @return bool
55     */
56    public function isLogoutButtonHidden(): bool
57    {
58        return filter_var(
59            $this->getOption(self::OPTION_HIDE_LOGOUT_BUTTON, false),
60            FILTER_VALIDATE_BOOLEAN
61        );
62    }
63
64    /**
65     * @param bool $hide
66     */
67    public function setHideLogoutButton(bool $hide): void
68    {
69        $this->setOption(self::OPTION_HIDE_LOGOUT_BUTTON, $hide);
70    }
71}