PiedWeb /
CMS
| 1 | <?php |
||
| 2 | |||
| 3 | namespace PiedWeb\CMSBundle\Entity; |
||
| 4 | |||
| 5 | use Doctrine\ORM\Mapping as ORM; |
||
| 6 | use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; |
||
| 7 | use Vich\UploaderBundle\Mapping\Annotation as Vich; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * @ORM\MappedSuperclass |
||
| 11 | * @Vich\Uploadable |
||
| 12 | * @ORM\HasLifecycleCallbacks |
||
| 13 | * UniqueEntity({"name"}, message="Ce nom existe déjà.") |
||
| 14 | */ |
||
| 15 | class Media implements MediaInterface |
||
| 16 | { |
||
| 17 | use IdTrait; |
||
| 18 | use MediaTrait; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 19 | |||
| 20 | 3 | public function __construct() |
|
| 21 | { |
||
| 22 | 3 | $this->updatedAt = null !== $this->updatedAt ? $this->updatedAt : new \DateTime(); |
|
| 23 | 3 | $this->createdAt = null !== $this->createdAt ? $this->createdAt : new \DateTime(); |
|
| 24 | 3 | } |
|
| 25 | } |
||
| 26 |