Test Setup Failed
Push — master ( de81f2...3dc847 )
by Tomasz
02:50
created

Domain::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
/**
3
 * Copyright
4
 */
5
namespace Hexarchium\CoreDomain\Model\Domain\Entity;
6
7
use Hexarchium\CoreDomain\Aggregate\AbstractAggregateRoot;
8
use Hexarchium\CoreDomain\Model\Domain\DomainId;
9
use Hexarchium\CoreDomain\Model\Domain\Events\DomainCreated;
10
11
12
class Domain extends AbstractAggregateRoot
13
{
14
    /**
15
     * Domain constructor.
16
     *
17
     * @param DomainId $id
18
     */
19
    public function __construct(DomainId $id)
20
    {
21
        parent::__construct($id);
22
23
        $this->pushEvent(
24
            new DomainCreated(new \DateTime(), $this)
25
        );
26
    }
27
}