| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | protected function execute(InputInterface $input, OutputInterface $output) |
||
| 24 | { |
||
| 25 | $manager = $this->getContainer()->get('doctrine.orm.entity_manager'); |
||
| 26 | |||
| 27 | $users = $this->getContainer()->get('doctrine')->getRepository(User::class)->findAll(); |
||
| 28 | |||
| 29 | $organizationId = OrganizationId::generate(); |
||
| 30 | $organization = new Organization( |
||
| 31 | $organizationId, |
||
| 32 | new OrganizationName('Organization name'), |
||
| 33 | new Slug('Organization name'), |
||
| 34 | new Owner( |
||
| 35 | OwnerId::generate( |
||
| 36 | $users[0]->id(), |
||
| 37 | $organizationId |
||
| 38 | ) |
||
| 39 | ) |
||
| 40 | ); |
||
| 41 | $manager->persist($organization); |
||
| 42 | $manager->flush(); |
||
| 43 | $output->writeln('Population is successfully done'); |
||
| 44 | } |
||
| 45 | } |
||
| 46 |