PageHasMedia::setPage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
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