PageHasMedia   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 52
ccs 0
cts 27
cp 0
rs 10
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getPosition() 0 3 1
A setPosition() 0 3 1
A getMedia() 0 3 1
A getPage() 0 3 1
A setPage() 0 3 1
A __toString() 0 3 1
A setMedia() 0 3 1
1
<?php
2
3
namespace PiedWeb\CMSBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * @ORM\MappedSuperclass
9
 * @ORM\HasLifecycleCallbacks
10
 */
11
class PageHasMedia implements PageHasMediaInterface
12
{
13
    use IdTrait;
14
15
    /**
16
     * @ORM\ManyToOne(targetEntity="PiedWeb\CMSBundle\Entity\MediaInterface", inversedBy="pageHasMedias")
17
     */
18
    protected $media;
19
20
    /**
21
     * @ORM\ManyToOne(targetEntity="PiedWeb\CMSBundle\Entity\PageInterface", inversedBy="pageHasMedias")
22
     */
23
    protected $page;
24
25
    /**
26
     * @ORM\Column(type="integer")
27
     */
28
    protected $position = 0;
29
30
    public function __toString()
31
    {
32
        return $this->getPage().' | '.$this->getMedia();
33
    }
34
35
    public function setPage(?PageInterface $page = null)
36
    {
37
        $this->page = $page;
38
    }
39
40
    public function getPage()
41
    {
42
        return $this->page;
43
    }
44
45
    public function setMedia(?MediaInterface $media = null)
46
    {
47
        $this->media = $media;
48
    }
49
50
    public function getMedia()
51
    {
52
        return $this->media;
53
    }
54
55
    public function setPosition($position)
56
    {
57
        $this->position = $position;
58
    }
59
60
    public function getPosition()
61
    {
62
        return $this->position;
63
    }
64
}
65