VideoTypeFixtures   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 17
dl 0
loc 44
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 35 1
1
<?php
2
3
namespace App\DataFixtures;
4
5
use App\Entity\VideoType;
6
use Doctrine\Bundle\FixturesBundle\Fixture;
7
use Doctrine\Common\Persistence\ObjectManager;
8
9
class VideoTypeFixtures extends Fixture
10
{
11
12
13
    /**
14
     * Load data fixtures with the passed EntityManager
15
     *
16
     * @param ObjectManager $manager
17
     */
18
    public function load(ObjectManager $manager)
19
    {
20
        $youtubeVideo = new VideoType();
21
22
        $youtubeVideo->setSite("Youtube");
23
        $youtubeVideo->setCode("
24
            <iframe width=\"100%\" height=\"100%\" src=\"https://www.youtube.com/embed/{{code}}\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>
25
        ");
26
        $youtubeVideo->setImageCode("https://img.youtube.com/vi/{{code}}/1.jpg");
27
28
        $manager->persist($youtubeVideo);
29
30
31
        $dailymotionVideo = new VideoType();
32
33
        $dailymotionVideo->setSite("DailyMotion");
34
        $dailymotionVideo->setCode("
35
            <iframe frameborder=\"0\" width=\"100%\" height=\"100%\" src=\"https://www.dailymotion.com/embed/video/{{code}}\" allowfullscreen allow=\"autoplay\"></iframe>
36
        ");
37
        $dailymotionVideo->setImageCode("https://www.dailymotion.com/thumbnail/video/{{code}}");
38
39
40
        $manager->persist($dailymotionVideo);
41
42
        $twitchVideo = new VideoType();
43
44
        $twitchVideo->setSite("Twitch");
45
        $twitchVideo->setCode("
46
            <iframe src=\"https://player.twitch.tv/?autoplay=false&video={{code}}\" frameborder=\"0\" allowfullscreen=\"true\" scrolling=\"no\" height=\"100%\" width=\"100%\"></iframe>
47
        ");
48
        $twitchVideo->setImageCode("https://www.twitch.tv/p/assets/uploads/combologo_474x356.png");
49
50
        $manager->persist($twitchVideo);
51
52
        $manager->flush();
53
54
    }
55
}