<?php

namespace App\DataFixtures;

use App\Entity\QuestionType;
use App\Entity\User;
use App\Entity\UserType;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Persistence\ObjectManager;

class AppFixtures extends Fixture
{

    public function load(ObjectManager $manager)
    {
        $userTypeSystem = new UserType('system');
        $manager->persist($userTypeSystem);

        $userTypeAdmin = new UserType('admin');
        $manager->persist($userTypeAdmin);

        $userTypeUser = new UserType('user');
        $manager->persist($userTypeUser);
        $manager->flush();

        $system = new User($manager, $userTypeSystem, 're@spawntree.de', 'System', 'System', "uAL4EX75HW6U");
        $manager->persist($system);
        $manager->flush();

        $admin = new User($manager, $userTypeAdmin, 'd.knudsen@spawntree.de', 'Daniel', 'Knudsen', "O3lT7E2bL1JG", $system);
        $manager->persist($admin);
        $manager->flush();

        $admin = new User($manager, $userTypeAdmin, 'f.eisenmenger@spawntree.de', 'Florian', 'Eisenmenger', "eS463G5LWnrN", $system);
        $manager->persist($admin);
        $manager->flush();

        $admin = new User($manager, $userTypeAdmin, 'office@RealFM.de', 'Roald', 'Niederlein', "5fSBM760JIvL", $system);
        $manager->persist($admin);
        $manager->flush();

        $questionType = new QuestionType('Rahmenbedingungen');
        $manager->persist($questionType);

        $questionType = new QuestionType('Prozesse inkl. Datenmanagement');
        $manager->persist($questionType);

        $questionType = new QuestionType('Mensch');
        $manager->persist($questionType);

        $questionType = new QuestionType('Technologie inkl. Datenaustausch');
        $manager->persist($questionType);
        $manager->flush();
    }

}
