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

Media::__construct()   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 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