Load data fixtures with the passed EntityManager.

@param ObjectManager $manager
776833
public function load(ObjectManager $manager)
    {
        /**
         * Carts.
         *
         * @var CartInterface     $emptyCart
         * @var CartInterface     $fullCart
         * @var CustomerInterface $customer1
         * @var CustomerInterface $customer2
         * @var ProductInterface  $product
         * @var ProductInterface  $productReduced
         * @var CartLineInterface $cartLine1
         * @var CartLineInterface $cartLine2
         * @var ObjectDirector    $cartDirector
         * @var ObjectDirector    $cartLineDirector
         * @var AddressInterface  $address1
         * @var AddressInterface  $address2
         */
        $cartDirector = $this->getDirector('cart');
        $cartLineDirector = $this->getDirector('cart_line');

        $customer1 = $this->getReference('customer-1');
        $customer2 = $this->getReference('customer-2');
        $product = $this->getReference('product');
        $productReduced = $this->getReference('product-reduced');

        $address1 = $this->getReference('address-sant-celoni');
        $address2 = $this->getReference('address-viladecavalls');

        /**
         * Empty cart.
         */
        $emptyCart = $cartDirector
            ->create()
            ->setCustomer($customer1);

        $cartDirector->save($emptyCart);
        $this->addReference('empty-cart', $emptyCart);

        /**
         * Full cart.
         */
        $fullCart = $cartDirector
            ->create()
            ->setCustomer($customer2);

        $cartLine1 = $cartLineDirector
            ->create()
            ->setPurchasable($product)
            ->setPurchasableAmount($product->getPrice())
            ->setAmount($product->getPrice())
            ->setQuantity(2)
            ->setCart($fullCart);

        $cartLine2 = $cartLineDirector
            ->create()
            ->setPurchasable($productReduced)
            ->setPurchasableAmount($productReduced->getPrice())
            ->setAmount($productReduced->getPrice())
            ->setQuantity(2)
            ->setCart($fullCart);

        $fullCart
            ->addCartLine($cartLine1)
            ->addCartLine($cartLine2);

        $fullCart->setBillingAddress($address1);
        $fullCart->setDeliveryAddress($address2);

        $cartDirector->save($fullCart);
        $this->addReference('full-cart', $fullCart);
    }
1298632
public function deleteEntityMap($objectManagerName)
    {
        $key = $this->getCacheKeyForObjectManagerName($objectManagerName);

        $cache = $this->getCache();

        if (true === $cache->contains($key)) {
            $cache->delete($key);
        }
    }
118033
protected function loadFiles(
        EntityManagerInterface $entityManager,
        $object,
        UploadableClassMetadata $uploadableMeta
    ): void {
        $this->assertIsObject($object);
        $propertyManipulator = $this->getPropertyManipulator($entityManager);
        foreach ($uploadableMeta->getUploadableProperties() as $property => $config) {
            $key = $propertyManipulator->getPropertyValue($object, $property);

            if (!empty($key)) {
                $propertyManipulator->setAndSaveValue(
                    $object,
                    $config['targetField'],
                    new File($key, $this->computeFilesystem($config))
                );
            }
        }
    }
1310902
protected function loadFromObjectManager(ClassMetadata $metadata, $data)
    {
        // Locate possible ObjectManager
        if (null === $objectManager = $this->getObjectManager($metadata)) {
            return null;
        }

        // Locate possible ClassMetadata
        $classMetadataFactory = $objectManager->getMetadataFactory();

        if ($classMetadataFactory->isTransient($metadata->getName())) {
            // No ClassMetadata found, proceed with normal deserialization
            return null;
        }

        if (! \is_array($data)) {
            // Single identifier, load
            return $objectManager->find($metadata->getName(), $data);
        }

        // Fallback to default constructor if missing identifier(s)
        $classMetadata = $objectManager->getClassMetadata($metadata->getName());
        $identifierList = [];

        foreach ($classMetadata->getIdentifierFieldNames() as $name) {
            if (! \array_key_exists($name, $data)) {
                continue;
            }

            $identifierList[$name] = $data[$name];
        }

        if (0 === \count($identifierList)) {
            return null;
        }

        // Entity update, load it from database
        return $objectManager->find($metadata->getName(), $identifierList);
    }
477081
public function load(ObjectManager $manager)
    {
        $food          = new Category('Food');
        $fruit         = new Category('Fruit');

        $apples        = new Category('Apples');
        $apples->setUnitDescriptionSingular('lb');
        $apples->setUnitDescriptionPlural('lbs');

        $vegetables    = new Category('Vegetables');

        $tomatoes      = new Category('Tomatoes');
        $tomatoes->setUnitDescriptionSingular('lb');
        $tomatoes->setUnitDescriptionPlural('lbs');

        $carrots       = new Category('Carrots');
        $carrots->setUnitDescriptionSingular('lb');
        $carrots->setUnitDescriptionPlural('lbs');

        $sweetPotatoes = new Category('Sweet Potatoes');
        $sweetPotatoes->setUnitDescriptionSingular('lb');
        $sweetPotatoes->setUnitDescriptionPlural('lbs');

        $onions        = new Category('Onions');
        $onions->setUnitDescriptionSingular('lb');
        $onions->setUnitDescriptionPlural('lbs');

        $meat          = new Category('Meat');
        $dairy         = new Category('Dairy');

        $milk          = new Category('Milk');
        $milk->setUnitDescriptionSingular('quart');
        $milk->setUnitDescriptionPlural('quarts');

        $eggs          = new Category('Eggs');
        $eggs->setUnitDescriptionSingular('dozen');
        $eggs->setUnitDescriptionPlural('dozen');

        $food->addCategory($fruit);
          $fruit->addCategory($apples);
        $food->addCategory($vegetables);
          $vegetables->addCategory($tomatoes);
          $vegetables->addCategory($carrots);
          $vegetables->addCategory($sweetPotatoes);
          $vegetables->addCategory($onions);
        $food->addCategory($meat);
        $food->addCategory($dairy);
          $dairy->addCategory($milk);
          $dairy->addCategory($eggs);

        $manager->persist($food);
        $manager->flush();

        $this->addReference('eggs-category', $eggs);
        $this->addReference('tomatoes-category', $tomatoes);
        $this->addReference('milk-category', $milk);
        $this->addReference('apples-category', $apples);
        $this->addReference('carrots-category', $carrots);
        $this->addReference('onions-category', $onions);
        $this->addReference('sweet-potatoes-category', $sweetPotatoes);
    }
446652
public function load(ObjectManager $manager)
    {
        $enTag = new Language;
        $enTag->setId('en');
        $enTag->setName(Translatable::createFromOriginalString('English'));

        $manager->persist($enTag);
        $manager->flush();
    }
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);
        }
    }
169134
public function load(ObjectManager $manager)
    {
        /**
         * @var ProductInterface  $productWithVariants
         * @var CurrencyInterface $currency
         * @var ObjectDirector    $variantDirector
         */
        $currency = $this->getReference('currency-dollar');
        $productWithVariants = $this->getReference('product-with-variants');
        $variantDirector = $this->getDirector('product_variant');

        /**
         * @var ValueInterface $optionWhite
         * @var ValueInterface $optionRed
         * @var ValueInterface $optionSmall
         * @var ValueInterface $optionLarge
         */
        $optionWhite = $this->getReference('value-color-white');
        $optionRed = $this->getReference('value-color-red');
        $optionSmall = $this->getReference('value-size-small');
        $optionLarge = $this->getReference('value-size-large');

        /**
         * Variant White-Small.
         */
        $variantWhiteSmall = $variantDirector
            ->create()
            ->setSku('variant-white-small-sku')
            ->setStock(100)
            ->setProduct($productWithVariants)
            ->addOption($optionWhite)
            ->addOption($optionSmall)
            ->setPrice(Money::create(1500, $currency))
            ->setHeight(13)
            ->setWidth(12)
            ->setDepth(19)
            ->setWeight(125)
            ->setEnabled(true);

        $productWithVariants->setPrincipalVariant($variantWhiteSmall);

        $variantDirector->save($variantWhiteSmall);
        $this->addReference('variant-white-small', $variantWhiteSmall);

        /**
         * Variant White-Large.
         */
        $variantWhiteLarge = $variantDirector
            ->create()
            ->setSku('variant-white-large-sku')
            ->setStock(100)
            ->setProduct($productWithVariants)
            ->addOption($optionWhite)
            ->addOption($optionLarge)
            ->setPrice(Money::create(1800, $currency))
            ->setHeight(12)
            ->setWidth(11)
            ->setDepth(45)
            ->setWeight(155)
            ->setEnabled(true);

        $variantDirector->save($variantWhiteLarge);
        $this->addReference('variant-white-large', $variantWhiteLarge);

        /**
         * Variant Red-Small.
         */
        $variantRedSmall = $variantDirector
            ->create()
            ->setSku('variant-red-small-sku')
            ->setStock(100)
            ->setProduct($productWithVariants)
            ->addOption($optionRed)
            ->addOption($optionSmall)
            ->setPrice(Money::create(1500, $currency))
            ->setHeight(19)
            ->setWidth(9)
            ->setDepth(33)
            ->setWeight(1000)
            ->setEnabled(true);

        $this->storeProductImage(
            $variantRedSmall,
            'variant.jpg'
        );

        $variantDirector->save($variantRedSmall);
        $this->addReference('variant-red-small', $variantRedSmall);

        /**
         * Variant Red-Large.
         */
        $variantRedLarge = $variantDirector
            ->create()
            ->setSku('variant-red-large-sku')
            ->setStock(100)
            ->setProduct($productWithVariants)
            ->addOption($optionRed)
            ->addOption($optionLarge)
            ->setPrice(Money::create(1800, $currency))
            ->setHeight(50)
            ->setWidth(30)
            ->setDepth(18)
            ->setWeight(70)
            ->setEnabled(true);

        $variantDirector->save($variantRedLarge);
        $this->addReference('variant-red-large', $variantRedLarge);
    }
282637
public function load(ObjectManager $manager)
    {
        /**
         * @var ObjectDirector $menuDirector
         */
        $menuDirector = $this->getDirector('menu');

        /**
         * Admin menu.
         */
        $menuAdmin = $menuDirector
            ->create()
            ->setCode('menu-admin')
            ->setEnabled(true)
            ->addSubnode($this->getReference('menu-node-vogue'));

        $menuDirector->save($menuAdmin);
        $this->addReference('menu-admin', $menuAdmin);

        /**
         * Front menu.
         */
        $menuFront = $menuDirector
            ->create()
            ->setCode('menu-front')
            ->setEnabled(true)
            ->addSubnode($this->getReference('menu-node-him'))
            ->addSubnode($this->getReference('menu-node-her'));

        $menuDirector->save($menuFront);
        $this->addReference('menu-front', $menuFront);
    }
403614
public function getLoader(ObjectManager $manager, $queryBuilder, $class, $hints = [])
    {
        $loader = new ORMQueryBuilderLoader($queryBuilder, $manager, $class);

        foreach ($hints as $name => $value) {
            $loader->setHint($name, $value);
        }

        return $loader;
    }
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();
    }
739960
protected function loadEntityManager(ContainerBuilder $container, $em)
    {
        $container->setParameter('ekino_wordpress.model_manager_name', $em);

        $reference = new Reference(sprintf('doctrine.orm.%s_entity_manager', $em));

        foreach (static::$entities as $entityName) {
            $container->findDefinition(sprintf('ekino.wordpress.manager.%s', $entityName))->replaceArgument(0, $reference);
        }
    }
1233531
public function load(ObjectManager $manager)
    {
        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('jon-seller'));
        $sellerHubRef->setHub($this->getReference('sam-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.5);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('jon-seller'));
        $sellerHubRef->setHub($this->getReference('nick-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.6);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('jon-seller'));
        $sellerHubRef->setHub($this->getReference('ramon-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.55);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();




        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('stephen-seller'));
        $sellerHubRef->setHub($this->getReference('sam-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.5);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('stephen-seller'));
        $sellerHubRef->setHub($this->getReference('nick-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.6);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('stephen-seller'));
        $sellerHubRef->setHub($this->getReference('ramon-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.55);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();




        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('jo-seller'));
        $sellerHubRef->setHub($this->getReference('sam-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.5);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('jo-seller'));
        $sellerHubRef->setHub($this->getReference('nick-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.6);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('jo-seller'));
        $sellerHubRef->setHub($this->getReference('ramon-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.55);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();




        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('sterling-seller'));
        $sellerHubRef->setHub($this->getReference('sam-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.5);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('sterling-seller'));
        $sellerHubRef->setHub($this->getReference('nick-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.6);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('sterling-seller'));
        $sellerHubRef->setHub($this->getReference('nick-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.6);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('11:00');
        $windowMaker->setEndTime('13:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('sterling-seller'));
        $sellerHubRef->setHub($this->getReference('ramon-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.55);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();




        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('tom-seller'));
        $sellerHubRef->setHub($this->getReference('sam-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.5);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('tom-seller'));
        $sellerHubRef->setHub($this->getReference('nick-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.6);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('tom-seller'));
        $sellerHubRef->setHub($this->getReference('ramon-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.55);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();
    }
1092134
public function load(ObjectManager $manager)
    {
        $data = [
            [
                'language' => 'de',
                'original' => 'German',
                'localized' => 'Deutsch'
            ],
            [
                'language' => 'de',
                'original' => 'English',
                'localized' => 'Englisch'
            ],
            [
                'language' => 'fr',
                'original' => 'English',
                'localized' => 'Anglais'
            ],
            [
                'language' => 'es',
                'original' => 'English',
                'localized' => 'Inglés'
            ]
        ];

        foreach ($data as $record) {
            $translation = new Translation();
            $translation->setLanguage($record['language']);
            $translation->setOriginal($record['original']);
            $translation->setLocalized($record['localized']);
            $manager->persist($translation);
            $manager->flush();
        }
    }
1264392
public function load(ObjectManager $manager)
    {
        $site2 = $this->getReference('site2');
        $site2->addBlock('slideshow');
        $site2->addBlock('gallery');

        $manager->flush();
    }
1265030
public function injectEntityManager(EntityManagerInterface $entityManager, ClassMetadata $classMetadata) : void
    {
        if ($entityManager !== self::$entityManager) {
            throw new RuntimeException(
                'Trying to use PersistentObject with different EntityManager instances. ' .
                'Was PersistentObject::setEntityManager() called?'
            );
        }

        $this->cm = $classMetadata;
    }
998935
public function load(ObjectManager $manager)
    {
        /**
         * @var ObjectDirector $configurationDirector
         */
        $configurationDirector = $this->getDirector('configuration');

        /**
         * Parameter.
         */
        $parameter = $configurationDirector
            ->create()
            ->setKey('my_boolean_parameter')
            ->setNamespace('app')
            ->setName('My Fixtures Boolean Parameter')
            ->setValue(true)
            ->setType('boolean');

        $configurationDirector->save($parameter);
    }