GalleryItem   A
last analyzed

Complexity

Total Complexity 13

Size/Duplication

Total Lines 97
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 13
lcom 0
cbo 0
dl 0
loc 97
rs 10
c 0
b 0
f 0

13 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 4 1
A setCreatedAt() 0 4 1
A getCreatedAt() 0 4 1
A setEnabled() 0 4 1
A getEnabled() 0 4 1
A setGallery() 0 4 1
A getGallery() 0 4 1
A setMedia() 0 4 1
A getMedia() 0 4 1
A setPosition() 0 4 1
A getPosition() 0 4 1
A setUpdatedAt() 0 4 1
A getUpdatedAt() 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\Model;
15
16
abstract class GalleryItem implements GalleryItemInterface
17
{
18
    /**
19
     * @var MediaInterface|null
20
     */
21
    protected $media;
22
23
    /**
24
     * @var GalleryInterface|null
25
     */
26
    protected $gallery;
27
28
    /**
29
     * @var int
30
     */
31
    protected $position = 0;
32
33
    /**
34
     * @var \DateTime|null
35
     */
36
    protected $updatedAt;
37
38
    /**
39
     * @var \DateTime|null
40
     */
41
    protected $createdAt;
42
43
    /**
44
     * @var bool
45
     */
46
    protected $enabled = false;
47
48
    public function __toString()
49
    {
50
        return $this->getGallery().' | '.$this->getMedia();
51
    }
52
53
    public function setCreatedAt(?\DateTime $createdAt = null): void
54
    {
55
        $this->createdAt = $createdAt;
56
    }
57
58
    public function getCreatedAt()
59
    {
60
        return $this->createdAt;
61
    }
62
63
    public function setEnabled($enabled): void
64
    {
65
        $this->enabled = $enabled;
66
    }
67
68
    public function getEnabled()
69
    {
70
        return $this->enabled;
71
    }
72
73
    public function setGallery(?GalleryInterface $gallery = null): void
74
    {
75
        $this->gallery = $gallery;
76
    }
77
78
    public function getGallery()
79
    {
80
        return $this->gallery;
81
    }
82
83
    public function setMedia(?MediaInterface $media = null): void
84
    {
85
        $this->media = $media;
86
    }
87
88
    public function getMedia()
89
    {
90
        return $this->media;
91
    }
92
93
    public function setPosition($position): void
94
    {
95
        $this->position = $position;
96
    }
97
98
    public function getPosition()
99
    {
100
        return $this->position;
101
    }
102
103
    public function setUpdatedAt(?\DateTime $updatedAt = null): void
104
    {
105
        $this->updatedAt = $updatedAt;
106
    }
107
108
    public function getUpdatedAt()
109
    {
110
        return $this->updatedAt;
111
    }
112
}
113