BaseGallery   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 24
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A prePersist() 0 5 1
A preUpdate() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\MediaBundle\Entity;
15
16
use Doctrine\Common\Collections\ArrayCollection;
17
use Sonata\MediaBundle\Model\Gallery;
18
19
/**
20
 * Bundle\MediaBundle\Entity\BaseGallery.
21
 */
22
abstract class BaseGallery extends Gallery
23
{
24
    public function __construct()
25
    {
26
        $this->galleryItems = new ArrayCollection();
27
    }
28
29
    /**
30
     * Pre Persist method.
31
     */
32
    public function prePersist(): void
33
    {
34
        $this->createdAt = new \DateTime();
35
        $this->updatedAt = new \DateTime();
36
    }
37
38
    /**
39
     * Pre Update method.
40
     */
41
    public function preUpdate(): void
42
    {
43
        $this->updatedAt = new \DateTime();
44
    }
45
}
46