AbstractRepository::insert()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 6
rs 10
c 0
b 0
f 0
ccs 0
cts 4
cp 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\ApiSkeleton\Repository;
6
7
use Chubbyphp\Model\Doctrine\DBAL\Repository\AbstractDoctrineRepository;
8
9
abstract class AbstractRepository extends AbstractDoctrineRepository
10
{
11
    /**
12
     * @param string $id
13
     * @param array  $row
14
     */
15
    protected function insert(string $id, array $row)
16
    {
17
        $row['createdAt'] = (new \DateTime())->format('Y-m-d H:i:s');
18
19
        parent::insert($id, $row);
20
    }
21
22
    /**
23
     * @param string $id
24
     * @param array  $row
25
     */
26
    protected function update(string $id, array $row)
27
    {
28
        $row['updatedAt'] = (new \DateTime())->format('Y-m-d H:i:s');
29
30
        parent::update($id, $row);
31
    }
32
}
33