Completed
Push — master ( 4966f7...fc3644 )
by WEBEWEB
01:31
created

DateTimeDateTrait::setDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2019 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\CoreBundle\Model\Attribute;
13
14
use DateTime;
15
16
/**
17
 * Date/time date trait.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Bundle\CoreBundle\Model\Attribute
21
 */
22
trait DateTimeDateTrait {
23
24
    /**
25
     * Date.
26
     *
27
     * @var DateTime
28
     */
29
    protected $date;
30
31
    /**
32
     * Get the date.
33
     *
34
     * @return DateTime Returns the date.
35
     */
36
    public function getDate() {
37
        return $this->date;
38
    }
39
40
    /**
41
     * Set the date.
42
     *
43
     * @param DateTime|null $date The date.
44
     */
45
    public function setDate(DateTime $date = null) {
46
        $this->date = $date;
47
        return $this;
48
    }
49
}
50