Passed
Push — master ( f8ce69...b14078 )
by payever
03:35
created

AbstractPaymentOptionEntity::setTranslations()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 2
nc 2
nop 1
1
<?php
2
/**
3
 * PHP version 5.4
4
 *
5
 * @category  MessageEntity
6
 * @package   Payever\Payments
7
 * @author    payever GmbH <[email protected]>
8
 * @copyright 2017-2019 payever GmbH
9
 * @license   MIT <https://opensource.org/licenses/MIT>
10
 * @link      https://getpayever.com/shopsystem/
11
 */
12
13
namespace Payever\ExternalIntegration\Payments\Http\MessageEntity;
14
15
use Payever\ExternalIntegration\Core\Http\MessageEntity\ResultEntity;
16
17
/**
18
 * This class represents List Payment Options Result Entity
19
 *
20
 * PHP version 5.4
21
 *
22
 * @category  MessageEntity
23
 * @package   Payever\Payments
24
 * @author    payever GmbH <[email protected]>
25
 * @copyright 2017-2019 payever GmbH
26
 * @license   MIT <https://opensource.org/licenses/MIT>
27
 * @link      https://getpayever.com/shopsystem/
28
 *
29
 * @method string                           getId()
30
 * @method string                           getName()
31
 * @method bool                             getStatus()
32
 * @method float                            getVariableFee()
33
 * @method float                            getFixedFee()
34
 * @method string                           getDescriptionOffer()
35
 * @method string                           getDescriptionFee()
36
 * @method float                            getMin()
37
 * @method float                            getMax()
38
 * @method string                           getPaymentMethod()
39
 * @method string                           getType()
40
 * @method string                           getSlug()
41
 * @method string                           getThumbnail1()
42
 * @method string                           getThumbnail2()
43
 * @method string                           getThumbnail3()
44
 * @method PaymentOptionOptionsEntity       getOptions()
45
 * @method PaymentOptionTranslationEntity[] getTranslations()
46
 * @method self                             setId()
47
 * @method self                             setName()
48
 * @method self                             setVariableFee()
49
 * @method self                             setFixedFee()
50
 * @method self                             setDescriptionOffer()
51
 * @method self                             setDescriptionFee()
52
 * @method self                             setMin()
53
 * @method self                             setMax()
54
 * @method self                             setPaymentMethod()
55
 * @method self                             setType()
56
 * @method self                             setSlug()
57
 * @method self                             setThumbnail1()
58
 * @method self                             setThumbnail2()
59
 * @method self                             setThumbnail3()
60
 */
61
abstract class AbstractPaymentOptionEntity extends ResultEntity
62
{
63
    /** @var string $id */
64
    protected $id;
65
66
    /** @var string $name */
67
    protected $name;
68
69
    /** @var bool $status */
70
    protected $status;
71
72
    /** @var float $variableFee */
73
    protected $variableFee;
74
75
    /** @var float $fixedFee */
76
    protected $fixedFee;
77
78
    /** @var string $descriptionOffer */
79
    protected $descriptionOffer;
80
81
    /** @var string $descriptionFee */
82
    protected $descriptionFee;
83
84
    /** @var float $min */
85
    protected $min;
86
87
    /** @var float $max */
88
    protected $max;
89
90
    /** @var string $paymentMethod */
91
    protected $paymentMethod;
92
93
    /** @var string $type */
94
    protected $type;
95
96
    /** @var string $slug */
97
    protected $slug;
98
99
    /** @var string $thumbnail1 */
100
    protected $thumbnail1;
101
102
    /** @var string $thumbnail2 */
103
    protected $thumbnail2;
104
105
    /** @var string $thumbnail3 */
106
    protected $thumbnail3;
107
108
    /** @var PaymentOptionOptionsEntity $options */
109
    protected $options;
110
111
    /** @var PaymentOptionTranslationEntity[] $translations */
112
    protected $translations;
113
114
    /**
115
     * Sets Status
116
     *
117
     * @param string $status
118
     */
119
    public function setStatus($status)
120
    {
121
        $this->status = $status == 'active';
122
    }
123
124
    /**
125
     * Sets Options
126
     *
127
     * @param array $options
128
     */
129
    public function setOptions($options)
130
    {
131
        $this->options = new PaymentOptionOptionsEntity($options);
132
    }
133
134
    /**
135
     * Sets Translations
136
     *
137
     * @param array $translations
138
     */
139
    public function setTranslations($translations)
140
    {
141
        $this->translations = array();
142
143
        foreach ($translations as $item) {
144
            $this->translations[] = new PaymentOptionTranslationEntity($item);
145
        }
146
    }
147
}
148