Conditions | 2 |
Paths | 2 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
18 | public function load(ObjectManager $manager): void |
||
19 | { |
||
20 | if ($manager instanceof EntityManager === false) { |
||
21 | throw new \InvalidArgumentException('UsersFixtures $manager should be instance of EntityManager'); |
||
22 | } |
||
23 | /* @var $manager EntityManager */ |
||
24 | |||
25 | $ukr = new Country('Ukraine', 'UKR'); |
||
26 | $pol = new Country('Poland', 'POL'); |
||
27 | $imdbUkr = new ImdbCountry($ukr); |
||
28 | $imdbPol = new ImdbCountry($pol); |
||
29 | |||
30 | $manager->getConnection()->exec("ALTER SEQUENCE countries_id_seq RESTART WITH 1; UPDATE countries SET id=nextval('countries_id_seq');"); |
||
31 | |||
32 | $manager->persist($ukr); |
||
33 | $manager->persist($pol); |
||
34 | $manager->persist($imdbUkr); |
||
35 | $manager->persist($imdbPol); |
||
36 | $manager->flush(); |
||
37 | } |
||
38 | } |
||
39 |