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

TagMapper::queueCreate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
c 0
b 0
f 0
nc 1
nop 3
dl 0
loc 8
rs 10
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