Completed
Push — master ( 1f36be...d8b059 )
by Beñat
03:59
created

Menu::id()   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
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the CMS Kernel library.
5
 *
6
 * Copyright (c) 2016 LIN3S <[email protected]>
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 LIN3S\CMSKernel\Domain\Model\Menu;
13
14
use LIN3S\CMSKernel\Domain\Model\Translation\Translatable;
15
16
/**
17
 * @author Beñat Espiña <[email protected]>
18
 */
19
class Menu extends Translatable
20
{
21
    private $id;
22
    private $createdOn;
23
    private $updatedOn;
24
25
    public function __construct(MenuId $id, MenuTranslation $translation)
26
    {
27
        parent::__construct($translation);
28
        $this->id = $id;
29
        $this->createdOn = new \DateTimeImmutable();
30
        $this->updatedOn = new \DateTimeImmutable();
31
    }
32
33
    public function id()
34
    {
35
        return $this->id;
36
    }
37
38
    public function createdOn()
39
    {
40
        return $this->createdOn;
41
    }
42
43
    public function updatedOn()
44
    {
45
        return $this->updatedOn;
46
    }
47
48
    public function __toString()
49
    {
50
        return (string) $this->id->id();
51
    }
52
}
53