Completed
Push — master ( b9ac9e...35a409 )
by Dev
03:48
created

Media::__construct_main()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 3
nc 4
nop 0
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