Passed
Pull Request — master (#49)
by
unknown
11:28
created

TagMapper   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 10
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A queueCreate() 0 8 1
1
<?php
2
3
namespace App\Blog\Tag;
4
5
use Cycle\Annotated\Annotation\Column;
6
use Cycle\Annotated\Annotation\Table;
7
use Cycle\ORM\Command\ContextCarrierInterface;
8
use Cycle\ORM\Heap\Node;
9
use Cycle\ORM\Heap\State;
10
use Cycle\ORM\Mapper\Mapper;
11
12
/**
13
 * @Table(
14
 *      columns={
15
 *          "created_at": @Column(type="datetime")
16
 *      }
17
 * )
18
 */
19
class TagMapper extends Mapper
20
{
21
    public function queueCreate($entity, Node $node, State $state): ContextCarrierInterface
22
    {
23
        $command = parent::queueCreate($entity, $node, $state);
24
25
        $state->register('created_at', new \DateTimeImmutable(), true);
26
        $command->register('created_at', new \DateTimeImmutable(), true);
27
28
        return $command;
29
    }
30
}
31