Test Failed
Branch develop (47adb0)
by Stone
04:36
created

Video::setVideoType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * @ORM\Entity(repositoryClass="App\Repository\VideoRepository")
9
 */
10
class Video extends AppEntity
11
{
12
    /**
13
     * @ORM\Id()
14
     * @ORM\GeneratedValue()
15
     * @ORM\Column(type="integer")
16
     */
17
    private $id;
18
19
    /**
20
     * @ORM\Column(type="string", length=255)
21
     */
22
    private $title;
23
24
    /**
25
     * @ORM\Column(type="string", length=255)
26
     */
27
    private $code;
28
29
    /**
30
     * @ORM\ManyToOne(targetEntity="App\Entity\Trick", inversedBy="videos")
31
     */
32
    private $trick;
33
34
    /**
35
     * @ORM\ManyToOne(targetEntity="App\Entity\VideoType", inversedBy="video")
36
     * @ORM\JoinColumn(nullable=false)
37
     */
38
    private $videoType;
39
40
    public function getId(): ?int
41
    {
42
        return $this->id;
43
    }
44
45
    public function getTitle(): ?string
46
    {
47
        return $this->title;
48
    }
49
50
    public function setTitle(string $title): self
51
    {
52
        $this->title = $title;
53
54
        return $this;
55
    }
56
57
    public function getCode(): ?string
58
    {
59
        return $this->code;
60
    }
61
62
    public function setCode(string $code): self
63
    {
64
        $this->code = $code;
65
66
        return $this;
67
    }
68
69
    public function getTrick(): ?Trick
70
    {
71
        return $this->trick;
72
    }
73
74
    public function setTrick(?Trick $trick): self
75
    {
76
        $this->trick = $trick;
77
78
        return $this;
79
    }
80
81
    public function getVideoType(): ?VideoType
82
    {
83
        return $this->videoType;
84
    }
85
86
    public function setVideoType(?VideoType $videoType): self
87
    {
88
        $this->videoType = $videoType;
89
90
        return $this;
91
    }
92
93
    public function getVideoIntegrationCode(){
94
        return str_replace("{{code}}", $this->getCode(), $this->getVideoType()->getCode());
95
    }
96
97
    public function getVideoIntegrationImage(){
98
        return str_replace("{{code}}", $this->getCode(), $this->getVideoType()->getImageCode());
99
    }
100
101
    public function __toString()
102
    {
103
        return $this->getTitle();
104
    }
105
}
106