Passed
Push — master ( 1710e4...0562aa )
by nguereza
03:29 queued 01:31
created

ProductCategory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A mapEntity() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Platine\App\Model\Entity;
6
7
use Platine\Orm\Entity;
8
use Platine\Orm\Mapper\EntityMapperInterface;
9
10
/**
11
* @class ProductCategory
12
* @package Platine\App\Model\Entity
13
* @extends Entity<ProductCategory>
14
*/
15
class ProductCategory extends Entity
16
{
17
    /**
18
    * @param EntityMapperInterface<ProductCategory> $mapper
19
    * @return void
20
    */
21
    public static function mapEntity(EntityMapperInterface $mapper): void
22
    {
23
        $mapper->table('product_categories');
24
        $mapper->useTimestamp();
25
        $mapper->casts([
26
           'created_at' => 'date',
27
           'updated_at' => '?date',
28
        ]);
29
    }
30
}
31