Completed
Push — master ( 35a409...546f84 )
by Dev
07:12 queued 03:21
created

Media   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 4
dl 0
loc 8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 3
1
<?php
2
3
namespace PiedWeb\CMSBundle\Entity;
4
5
use Gedmo\Timestampable\Traits\TimestampableEntity;
6
use Doctrine\ORM\Mapping as ORM;
7
use Vich\UploaderBundle\Mapping\Annotation as Vich;
8
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
9
use Sonata\TranslationBundle\Model\Gedmo\TranslatableInterface;
10
11
/**
12
 * @ORM\MappedSuperclass
13
 * @Vich\Uploadable
14
 * UniqueEntity({"name"}, message="Ce nom existe déjà.")
15
 */
16
class Media implements TranslatableInterface, MediaInterface
17
{
18
    use IdTrait, MediaTrait, TranslatableTrait;
19
20
    public function __construct()
21
    {
22
        $this->updatedAt = null !== $this->updatedAt ? $this->updatedAt : new \DateTime();
23
        $this->createdAt = null !== $this->createdAt ? $this->createdAt : new \DateTime();
24
    }
25
}
26