Load data fixtures with the passed EntityManager

@param ObjectManager $manager
975156
public function load(ObjectManager $manager)
    {
        $settingsClass = $this->container->getParameter('blog_settings_class');

        $commentsSwitch = new $settingsClass();
        $commentsSwitch
            ->setProperty('comments_enabled')
            ->setValue(BlogSettings::COMMENTS_ENABLED);
        $manager->persist($commentsSwitch);

        $commentsPublicAccess = new $settingsClass();
        $commentsPublicAccess
            ->setProperty('comments_visible_public')
            ->setValue(BlogSettings::COMMENTS_PUBLIC_VISIBLE);

        $manager->persist($commentsPublicAccess);

        $commenterAccessLevel = new $settingsClass();
        $commenterAccessLevel
            ->setProperty('commenter_access_level')
            ->setValue(BlogSettings::COMMENTER_ACCESS_LEVEL_PUBLIC);

        $manager->persist($commenterAccessLevel);

        $manager->flush();
    }
256474
public function manager(RendererManager $manager, Container $container)
    {
        $this->rendererManager = $manager;

        // Prepare Globals
        $this->prepareGlobals($container, $manager);

        return $manager;
    }
173656
protected function loadManager(InputInterface $input, OutputInterface $output)
    {
        if ($this->getManager() === null) {
            $manager = new Manager($this->getConfig(), $input, $output);
            $this->setManager($manager);
        } else {
            $manager = $this->getManager();
            $manager->setInput($input);
            $manager->setOutput($output);
        }
    }
1221668
public function load(ObjectManager $manager)
    {
        $testClient = new ApiClient();
        $testClient->setName('Test client');
        $testClient->setKey('test_key');
        $testClient->setSecret('test_secret');
        $testClient->setTrusted(true);

        $manager->persist($testClient);
        $manager->flush();
    }
851441
public function setConnectionManager(ManagerInterface $manager)
    {
        $this->connectionManager = $manager;
        foreach ($this->servers as $server) {
            $this->connectionManager->addServer($server);
        }
    }
1329083
public function load(ObjectManager $manager)
    {
        /**
         * Carts.
         *
         * @var CartCouponInterface $cartCoupon
         * @var CartInterface       $cart
         * @var CouponInterface     $coupon
         */
        $cartCouponDirectory = $this->getDirector('cart_coupon');

        $cart = $this->getReference('full-cart');
        $coupon = $this->getReference('coupon-percent');

        $cartCoupon = $cartCouponDirectory
            ->create()
            ->setCart($cart)
            ->setCoupon($coupon);

        $cartCouponDirectory->save($cartCoupon);
        $this->addReference('cart-coupon', $cartCoupon);
    }
861997
public function load(ObjectManager $manager)
    {
        $gal = new Folder($manager);
        $gal->setName('Media');
        $gal->setTranslatableLocale('en');
        $gal->setRel('media');
        $manager->persist($gal);
        $manager->flush();
        $this->addReference('media-folder-en', $gal);

        $gal->setTranslatableLocale('nl');
        $manager->refresh($gal);
        $gal->setName('Media');
        $manager->persist($gal);
        $manager->flush();

        $gal->setTranslatableLocale('fr');
        $manager->refresh($gal);
        $gal->setName('Media');
        $manager->persist($gal);
        $manager->flush();

        $subgal = new Folder($manager);
        $subgal->setParent($gal);
        $subgal->setName('Images');
        $subgal->setTranslatableLocale('en');
        $subgal->setRel('image');
        $manager->persist($subgal);
        $manager->flush();
        $this->addReference('images-folder-en', $subgal);

        $subgal->setTranslatableLocale('nl');
        $manager->refresh($subgal);
        $subgal->setName('Afbeeldingen');
        $manager->persist($subgal);
        $manager->flush();

        $subgal->setTranslatableLocale('fr');
        $manager->refresh($subgal);
        $subgal->setName('Images');
        $manager->persist($subgal);
        $manager->flush();

        $subgal = new Folder($manager);
        $subgal->setParent($gal);
        $subgal->setName('Videos');
        $subgal->setTranslatableLocale('en');
        $subgal->setRel('video');
        $manager->persist($subgal);
        $manager->flush();
        $this->addReference('videos-folder-en', $subgal);

        $subgal->setTranslatableLocale('nl');
        $manager->refresh($subgal);
        $subgal->setName('Video\'s');
        $manager->persist($subgal);
        $manager->flush();

        $subgal->setTranslatableLocale('fr');
        $manager->refresh($subgal);
        $subgal->setName('Vidéos');
        $manager->persist($subgal);
        $manager->flush();

        $subgal = new Folder($manager);
        $subgal->setParent($gal);
        $subgal->setName('Slides');
        $subgal->setTranslatableLocale('en');
        $subgal->setRel('slideshow');
        $manager->persist($subgal);
        $manager->flush();
        $this->addReference('slides-folder-en', $subgal);

        $subgal->setTranslatableLocale('nl');
        $manager->refresh($subgal);
        $subgal->setName('Presentaties');
        $manager->persist($subgal);
        $manager->flush();

        $subgal->setTranslatableLocale('fr');
        $manager->refresh($subgal);
        $subgal->setName('Presentations');
        $manager->persist($subgal);
        $manager->flush();

        $subgal = new Folder($manager);
        $subgal->setParent($gal);
        $subgal->setName('Files');
        $subgal->setTranslatableLocale('en');
        $subgal->setRel('files');
        $manager->persist($subgal);
        $manager->flush();
        $this->addReference('files-folder-en', $subgal);

        $subgal->setTranslatableLocale('nl');
        $manager->refresh($subgal);
        $subgal->setName('Bestanden');
        $manager->persist($subgal);
        $manager->flush();

        $subgal->setTranslatableLocale('fr');
        $manager->refresh($subgal);
        $subgal->setName('Fichiers');
        $manager->persist($subgal);
        $manager->flush();
    }
496950
public function load(ObjectManager $manager)
    {
        $this->manager = $manager;
        $options = $this->getOptions();

        $parser = new Parser();

        $data = [];
        foreach ($this->getFixtures() as $fixture) {
            $data[] = $parser->parse(file_get_contents($fixture));
        }

        $fixtures = $this->initFixtures($data);
        $builder = $this->container->get('kunstmaan_fixtures.builder.builder');
        $locale = isset($options['locale']) ? $options['locale'] : 'en_US';

        foreach ($this->getProviders() as $provider) {
            $builder->addProvider($provider);
        }

        /*
         * because of faker's magic calls we'll want to add this as last provider
         */
        $builder->addProvider(Factory::create($locale));
        $builder->setFixtures($fixtures);
        $builder->buildFixtures($manager);
    }
250659
protected function loadFixtures(
        LoaderInterface $loader,
        EntityManagerInterface $manager,
        array $files,
        array $parameters,
        ?PurgeMode $purgeMode
    ) {
        $persister = $this->createPersister($manager);

        $loader = $loader->withPersister($persister);

        return $loader->load($files, $parameters, [], $purgeMode);
    }
889920
public function load(ObjectManager $manager)
    {
        // Assumes first user is admin user
        $user = $manager->find('OrkestraApplicationBundle:User', 1);

        $author = new Author();
        $author->setUser($user);
        $manager->persist($author);

        $menu = new Menu();
        $menu->setName('main_nav');
        $menu->setType('main_nav');
        $menu->setDefinition($this->getMainNavDefinition());
        $manager->persist($menu);

        $manager->flush();
    }
447673
private function createRole(ObjectManager $manager, $name)
    {
        $role = new Role($name);
        $manager->persist($role);

        return $role;
    }
43314
public function load(ObjectManager $manager)
    {
        if ($this->container->getParameter('kunstmaan_admin.multi_language')) {
            $languages = explode('|', $this->container->getParameter('kunstmaan_admin.required_locales'));
        }
        if (!is_array($languages) || count($languages) < 1) {
            $languages = array('en');
        }

        $em = $this->container->get('doctrine.orm.entity_manager');

        $pageCreator = $this->container->get('kunstmaan_node.page_creator_service');

        // Create article overview page
        $nodeRepo = $em->getRepository('KunstmaanNodeBundle:Node');
        $homePage = $nodeRepo->findOneBy(array('internalName' => 'homepage'));

        $searchPage = new SearchPage();
        $searchPage->setTitle('Search');

        $translations = array();
        foreach ($languages as $lang) {
            if ($lang == 'nl') {
                $title = 'Zoeken';
            } else {
                $title = 'Search';
            }

            $translations[] = array('language' => $lang, 'callback' => function($page, $translation, $seo) use($title) {
                $translation->setTitle($title);
                $translation->setWeight(50);
                $slugifier = $this->container->get('kunstmaan_utilities.slugifier');
                $translation->setSlug($slugifier->slugify($title));
            });
        }

        $options = array(
            'parent' => $homePage,
            'page_internal_name' => 'search',
            'set_online' => true,
            'hidden_from_nav' => true,
            'creator' => 'Admin'
        );

        $pageCreator->createPage($searchPage, $translations, $options);
    }
250908
public function getLoader(ObjectManager $manager, $queryBuilder, $class)
    {
        $queryBuilder->innerJoin(NodeVersion::class, 'nv', Join::WITH, 'nv.refId = e.id and nv.refEntityName = :ref_name');

        $queryBuilder->innerJoin(NodeTranslation::class, 'nt', Join::WITH, 'nt.id = nv.nodeTranslation and nt.publicNodeVersion = nv.id');
        $queryBuilder->innerJoin(Node::class, 'n', Join::WITH, 'n.id = nt.node');

        $queryBuilder->andWhere($queryBuilder->expr()->eq("n.deleted", 0));
        $queryBuilder->andWhere($queryBuilder->expr()->eq('nt.online', 1));
        $queryBuilder->setParameter("ref_name", $class);

        if (null !== $queryBuilder->getParameter('left') && null !== $queryBuilder->getParameter('right')) {
            $queryBuilder->andWhere('n.lft >= :left')->andWhere('n.rgt <= :right');
        }

        if (null !== $queryBuilder->getParameter('lang')) {
            $queryBuilder->andWhere('nt.lang = :lang');
        }

        return new ORMQueryBuilderLoader(
            $queryBuilder,
            $manager,
            $class
        );
    }
282735
public function load(ObjectManager $manager)
    {
        if (true == $this->hasReference('workflow-function-validator-production')) {
            $workflowRight = new WorkflowRight();
            $workflowRight->setUserId($this->getReference('user-admin')->getId());

            $authorization = new Authorization();
            $authorization->setReferenceId(WorkflowRightInterface::NODE);
            $authorization->addWorkflowFunction($this->getReference('workflow-function-validator-production'));

            $workflowRight->addAuthorization($authorization);

            $manager->persist($workflowRight);
            $manager->flush();
        }
    }
776452
public function loadEntityMap($objectManagerName)
    {
        $key = $this->getCacheKeyForObjectManagerName($objectManagerName);

        $cache = $this->getCache();

        if (false === $cache->contains($key)) {
            return false;
        }

        return $cache->fetch($key);
    }
18909
public function load(ObjectManager $manager)
    {
        $em = $this->container->get('doctrine.orm.entity_manager');

        $pageCreator = $this->container->get('kunstmaan_node.page_creator_service');

        $nodeRepo = $em->getRepository('KunstmaanNodeBundle:Node');
        $homePage = $nodeRepo->findOneBy(array('internalName' => 'homepage'));

        $sitemapPage = new SitemapPage();
        $sitemapPage->setTitle('Sitemap');

	$locales = explode('|', $this->container->getParameter('requiredlocales'));
        $translations = array();
	foreach ($locales as $locale) {
	    $translations[] = array('language' => $locale, 'callback' => function($page, $translation, $seo) {
		$translation->setTitle('Sitemap');
		$translation->setSlug('sitemap');
		$translation->setWeight(100);
	    });
	}

        $options = array(
            'parent' => $homePage,
            'page_internal_name' => 'sitemap',
            'set_online' => true,
            'hidden_from_nav' => true,
            'creator' => 'admin'
        );

        $pageCreator->createPage($sitemapPage, $translations, $options);
    }
1338428
protected function getObjectManager(ClassMetadata $metadata): ?ObjectManager
    {
        foreach ($this->managerRegistryCollection as $managerRegistry) {
            if ($objectManager = $managerRegistry->getManagerForClass($metadata->getName())) {
                return $objectManager;
            }
        }

        return null;
    }