Completed
Pull Request — master (#21)
by Valentyn
01:42
created

GenresFixtures   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 11 1
1
<?php
2
3
namespace App\DataFixtures;
4
5
use App\Entity\Genre;
6
use App\Entity\Translations\GenreTranslations;
7
use Doctrine\Bundle\FixturesBundle\Fixture;
8
use Doctrine\Common\Persistence\ObjectManager;
9
10
class GenresFixtures extends Fixture
11
{
12
13
    public function load(ObjectManager $manager): void
14
    {
15
        $comedy = new Genre();
16
        $comedy
17
            ->addTranslation(new GenreTranslations($comedy, 'en', 'Comedy'))
18
            ->addTranslation(new GenreTranslations($comedy, 'uk', 'Комедія'))
19
            ->addTranslation(new GenreTranslations($comedy, 'ru', 'Комедия'));
20
21
        $manager->persist($comedy);
22
        $manager->flush();
23
    }
24
25
}