Completed
Push — master ( b9ac9e...35a409 )
by Dev
03:48
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_main() 0 4 3
1
<?php
2
3
namespace PiedWeb\CMSBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Vich\UploaderBundle\Mapping\Annotation as Vich;
7
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
8
use Sonata\TranslationBundle\Model\Gedmo\TranslatableInterface;
9
10
/**
11
 * @ORM\MappedSuperclass
12
 * @Vich\Uploadable
13
 * UniqueEntity({"name"}, message="Ce nom existe déjà.")
14
 */
15
class Media implements TranslatableInterface, MediaInterface
16
{
17
    use IdTrait, MediaTrait, TranslatableTrait;
18
19
    public function __construct_main()
20
    {
21
        $this->updatedAt = null !== $this->updatedAt ? $this->updatedAt : new \DateTime();
22
        $this->createdAt = null !== $this->createdAt ? $this->createdAt : new \DateTime();
23
    }
24
}
25