SubscriptionRequestEntity::addAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * PHP version 5.4 and 8
5
 *
6
 * @category  RequestEntity
7
 * @package   Payever\ThirdParty
8
 * @author    payever GmbH <[email protected]>
9
 * @author    Hennadii.Shymanskyi <[email protected]>
10
 * @copyright 2017-2021 payever GmbH
11
 * @license   MIT <https://opensource.org/licenses/MIT>
12
 * @link      https://docs.payever.org/shopsystems/api/getting-started
13
 */
14
15
namespace Payever\ExternalIntegration\ThirdParty\Http\RequestEntity;
16
17
use Payever\ExternalIntegration\Core\Http\RequestEntity;
18
use Payever\ExternalIntegration\ThirdParty\Http\MessageEntity\SubscriptionActionEntity;
19
20
/**
21
 * @method string getExternalId()
22
 * @method string getThirdPartyName()
23
 * @method string getBusinessUuid()
24
 * @method SubscriptionActionEntity[] getActions()
25
 * @method self setExternalId(string $externalId)
26
 * @method self setThirdPartyName(string $name)
27
 * @method self setBusinessUuid(string $businessUuid)
28
 * @method self setActions(SubscriptionActionEntity[] $actions)
29
 */
30
class SubscriptionRequestEntity extends RequestEntity
31
{
32
    const UNDERSCORE_ON_SERIALIZATION = false;
33
34
    /** @var string */
35
    protected $businessUuid;
36
37
    /** @var string */
38
    protected $externalId;
39
40
    /**
41
     * @see \Payever\ExternalIntegration\Core\Enum\ChannelSet
42
     *
43
     * @var string
44
     */
45
    protected $thirdPartyName;
46
47
    /** @var SubscriptionActionEntity[] */
48
    protected $actions = [];
49
50
    /**
51
     * @param SubscriptionActionEntity $actionEntity
52
     *
53
     * @return static
54
     */
55
    public function addAction(SubscriptionActionEntity $actionEntity)
56
    {
57
        $this->actions[] = $actionEntity;
58
59
        return $this;
60
    }
61
62
    /**
63
     * @return array
64
     */
65
    public function getRequired()
66
    {
67
        return [
68
            'businessUuid',
69
            'thirdPartyName',
70
        ];
71
    }
72
}
73