Completed
Pull Request — master (#22)
by Matthias
03:17
created

ProductBundleSlotOptions::setAsPresentationSlot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace solutionDrive\SyliusProductBundlesPlugin\Service\Options;
6
7
/**
8
 * Created by solutionDrive GmbH
9
 *
10
 * @copyright 2018 solutionDrive GmbH
11
 */
12
class ProductBundleSlotOptions implements ProductBundleSlotOptionsInterface
13
{
14
    /** @var int */
15
    private $position;
16
17
    /** @var bool */
18
    private $isPresentationSlot = false;
19
20
    /** @var array */
21
    private $additionalOptions = [];
22
23
    public function addOption(string $name, $value): void
24
    {
25
        $this->additionalOptions[$name] = $value;
26
    }
27
28
    public function getOption(string $name)
29
    {
30
        return $this->additionalOptions[$name];
31
    }
32
33
    public function setPosition(int $position): void
34
    {
35
        $this->position = $position;
36
    }
37
38
    public function getPosition(): int
39
    {
40
        return $this->position;
41
    }
42
43
    public function setAsPresentationSlot(): void
44
    {
45
        $this->isPresentationSlot = true;
46
    }
47
48
    public function isPresentationSlot(): bool
49
    {
50
        return $this->isPresentationSlot;
51
    }
52
}
53