ChannelSetEntity::setCreatedAt()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
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 7
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
/**
4
 * PHP version 5.4 and 8
5
 *
6
 * @category  MessageEntity
7
 * @package   Payever\Core
8
 * @author    payever GmbH <[email protected]>
9
 * @copyright 2017-2021 payever GmbH
10
 * @license   MIT <https://opensource.org/licenses/MIT>
11
 * @link      https://docs.payever.org/shopsystems/api/getting-started
12
 */
13
14
namespace Payever\ExternalIntegration\Core\Http\MessageEntity;
15
16
use Payever\ExternalIntegration\Core\Base\MessageEntity;
17
18
/**
19
 * This class represents Channel Set Entity
20
 *
21
 * @method int getId()
22
 * @method string getName()
23
 * @method string getSlug()
24
 * @method bool getConfigured()
25
 * @method \DateTime|false getCreatedAt()
26
 * @method \DateTime|false getUpdatedAt()
27
 * @method string getDiscr()
28
 * @method self setId(string $id)
29
 * @method self setName(string $name)
30
 * @method self setSlug(string $slug)
31
 * @method self setDiscr(string $discr)
32
 *
33
 * @SuppressWarnings(PHPMD.ShortVariable)
34
 */
35
class ChannelSetEntity extends MessageEntity
36
{
37
    /** @var int $id */
38
    protected $id;
39
40
    /** @var string $name */
41
    protected $name;
42
43
    /** @var string $slug */
44
    protected $slug;
45
46
    /** @var bool $configured */
47
    protected $configured;
48
49
    /** @var \DateTime|bool $createdAt */
50
    protected $createdAt;
51
52
    /** @var \DateTime|bool $updatedAt */
53
    protected $updatedAt;
54
55
    /** @var string $discr */
56
    protected $discr;
57
58
    /**
59
     * Sets Configured
60
     *
61
     * @param string $configured
62
     * @return self
63
     */
64
    public function setConfigured($configured)
65
    {
66
        $this->configured = filter_var($configured, FILTER_VALIDATE_BOOLEAN);
67
68
        return $this;
69
    }
70
71
    /**
72
     * Sets Created At
73
     *
74
     * @param string $createdAt
75
     * @return self
76
     */
77
    public function setCreatedAt($createdAt)
78
    {
79
        if ($createdAt) {
80
            $this->createdAt = date_create($createdAt);
81
        }
82
83
        return $this;
84
    }
85
86
    /**
87
     * Sets Updated At
88
     *
89
     * @param string $updatedAt
90
     * @return self
91
     */
92
    public function setUpdatedAt($updatedAt)
93
    {
94
        if ($updatedAt) {
95
            $this->updatedAt = date_create($updatedAt);
96
        }
97
98
        return $this;
99
    }
100
}
101