Passed
Pull Request — master (#49)
by
unknown
15:36
created

TagMapper   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
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\Mapper;
4
5
use Cycle\Annotated\Annotation\Column;
6
use Cycle\Annotated\Annotation\Table;
7
use Cycle\ORM\Command\ContextCarrierInterface;
8
use Cycle\ORM\Command\CommandInterface;
9
use Cycle\ORM\Command\Database\Update;
10
use Cycle\ORM\Context\ConsumerInterface;
11
use Cycle\ORM\Heap\Node;
12
use Cycle\ORM\Heap\State;
13
use Cycle\ORM\Mapper\Mapper;
14
15
/**
16
 * @Table(
17
 *      columns={
18
 *          "created_at": @Column(type="datetime")
19
 *      }
20
 * )
21
 */
22
class TagMapper extends Mapper
23
{
24
    public function queueCreate($entity, Node $node, State $state): ContextCarrierInterface
25
    {
26
        $command = parent::queueCreate($entity, $node, $state);
27
28
        $state->register('created_at', new \DateTimeImmutable(), true);
29
        $command->register('created_at', new \DateTimeImmutable(), true);
30
31
        return $command;
32
    }
33
}
34