Loads sample fixtures for product Variant entities.

@param ObjectManager $manager
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);
    }
1338428
protected function getObjectManager(ClassMetadata $metadata): ?ObjectManager
    {
        foreach ($this->managerRegistryCollection as $managerRegistry) {
            if ($objectManager = $managerRegistry->getManagerForClass($metadata->getName())) {
                return $objectManager;
            }
        }

        return null;
    }
1302050
public function load(ObjectManager $manager)
    {
        $geocoder = new \HarvestCloud\GeoBundle\Util\GoogleGeocoder();

        $user = new User();
        $user->setEmail('sam.hub@example.com');
        $user->setFirstname('Sam');
        $user->setLastname('Hub');
        $user->setEnabled(true);

        $encoder = $this->container
            ->get('security.encoder_factory')
            ->getEncoder($user)
        ;

        $user->setPassword($encoder->encodePassword('hub', $user->getSalt()));

        $profile = new Profile();
        $profile->setName($user->getFullname());
        $profile->setSystemHubStatus(Profile::STATUS_ENABLED);
        $profile->setHubStatus(Profile::STATUS_ACTIVE);

        $user->addProfile($profile);

        $location = new Location();
        $location->setName('Default');
        $location->setAddressLine1('100 East Street');
        $location->setTown('Great Barrington');
        $location->setStateCode('MA');
        $location->setPostalCode('01230');

        $geocoder->geocode($location);

        $profile->addLocation($location);

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

        $this->addReference('sam-hub', $profile);


        $user = new User();
        $user->setEmail('nick.hub@example.com');
        $user->setFirstname('Nick');
        $user->setLastname('Hub');
        $user->setEnabled(true);

        $encoder = $this->container
            ->get('security.encoder_factory')
            ->getEncoder($user)
        ;

        $user->setPassword($encoder->encodePassword('hub', $user->getSalt()));

        $profile = new Profile();
        $profile->setName($user->getFullname());
        $profile->setSystemHubStatus(Profile::STATUS_ENABLED);
        $profile->setHubStatus(Profile::STATUS_ACTIVE);

        $user->addProfile($profile);

        $location = new Location();
        $location->setName('Default');
        $location->setAddressLine1('100 Main Street');
        $location->setTown('Stockbridge');
        $location->setStateCode('MA');
        $location->setPostalCode('01262');

        $geocoder->geocode($location);

        $profile->addLocation($location);

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

        $this->addReference('nick-hub', $profile);


        $user = new User();
        $user->setEmail('ramon.hub@example.com');
        $user->setFirstname('Ramon');
        $user->setLastname('Hub');
        $user->setEnabled(true);

        $encoder = $this->container
            ->get('security.encoder_factory')
            ->getEncoder($user)
        ;

        $user->setPassword($encoder->encodePassword('hub', $user->getSalt()));

        $profile = new Profile();
        $profile->setName($user->getFullname());
        $profile->setSystemHubStatus(Profile::STATUS_ENABLED);
        $profile->setHubStatus(Profile::STATUS_ACTIVE);

        $user->addProfile($profile);

        $location = new Location();
        $location->setName('Default');
        $location->setAddressLine1('10 East Street');
        $location->setTown('Lenox');
        $location->setStateCode('MA');
        $location->setPostalCode('01240');

        $geocoder->geocode($location);

        $profile->addLocation($location);

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

        $this->addReference('ramon-hub', $profile);
    }
48487
public function load(ObjectManager $manager)
    {
        $howManyApps = 15;
        $createdCount = 0;

        while ($createdCount < $howManyApps) {
            $app = new App;
            $app->setId('app'.$createdCount);
            $app->setName('App'.$createdCount);
            $app->setShowInMenu(true);
            $app->setOrder($createdCount);

            $manager->persist($app);
            $createdCount++;
        }

        $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);
    }
514328
protected function loadObjects()
    {
        if (! empty($this->objects)) {
            return;
        }

        $findMethod = (array) $this->getFindMethod();

        if (! $findMethod) {
            $findMethodName = 'findAll';
            $repository     = $this->objectManager->getRepository($this->targetClass);
            $objects        = $repository->findAll();
        } else {
            if (! isset($findMethod['name'])) {
                throw new RuntimeException('No method name was set');
            }
            $findMethodName   = $findMethod['name'];
            $findMethodParams = isset($findMethod['params']) ? array_change_key_case($findMethod['params']) : [];
            $repository       = $this->objectManager->getRepository($this->targetClass);

            if (! method_exists($repository, $findMethodName)) {
                throw new RuntimeException(
                    sprintf(
                        'Method "%s" could not be found in repository "%s"',
                        $findMethodName,
                        get_class($repository)
                    )
                );
            }

            $r    = new ReflectionMethod($repository, $findMethodName);
            $args = [];

            foreach ($r->getParameters() as $param) {
                if (array_key_exists(strtolower($param->getName()), $findMethodParams)) {
                    $args[] = $findMethodParams[strtolower($param->getName())];
                } elseif ($param->isDefaultValueAvailable()) {
                    $args[] = $param->getDefaultValue();
                } elseif (! $param->isOptional()) {
                    throw new RuntimeException(
                        sprintf(
                            'Required parameter "%s" with no default value for method "%s" in repository "%s"'
                            . ' was not provided',
                            $param->getName(),
                            $findMethodName,
                            get_class($repository)
                        )
                    );
                }
            }
            $objects = $r->invokeArgs($repository, $args);
        }

        $this->guardForArrayOrTraversable(
            $objects,
            sprintf('%s::%s() return value', get_class($repository), $findMethodName),
            'DoctrineModule\Form\Element\Exception\InvalidRepositoryResultException'
        );

        $this->objects = $objects;
    }
464134
public function load(ObjectManager $manager)
    {
        for($i=1; $i <= 4; $i++)
        {

            $post = new Post();
            $post->setName('title'.$i);
            $post->setSlug('title-'.$i);
            $post->setContent('content '.$i);
            $post->setCreatedAt(new \DateTime());

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

        }
    }
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);
    }
1260485
public function load(ObjectManager $manager)
    {
        $geocoder = new \HarvestCloud\GeoBundle\Util\GoogleGeocoder();

        $buyer = new User();
        $buyer->setEmail('harvest.cloud@example.com');
        $buyer->setFirstname('Harvest');
        $buyer->setLastname('Cloud');
        $buyer->setEnabled(false);
        $buyer->setPassword('');

        $buyerProfile = new Profile();
        $buyerProfile->setName($buyer->getFullname());

        $buyer->addProfile($buyerProfile);

        $location = new Location();
        $location->setName('Default');
        $location->setAddressLine1('150 Main Street');
        $location->setTown('Great Barrington');
        $location->setStateCode('MA');
        $location->setPostalCode('01230');

        $geocoder->geocode($location);

        $buyerProfile->addLocation($location);

        $exchange = $this->container->get('exchange_manager')->getExchange();

        $exchange->setProfile($buyerProfile);

        $manager->persist($exchange);
        $manager->persist($buyer);
        $manager->flush();


        $buyer = new User();
        $buyer->setEmail('craig.buyer@example.com');
        $buyer->setFirstname('Craig');
        $buyer->setLastname('Buyer');
        $buyer->setEnabled(true);

        $encoder = $this->container
            ->get('security.encoder_factory')
            ->getEncoder($buyer)
        ;

        $buyer->setPassword($encoder->encodePassword('buyer', $buyer->getSalt()));

        $buyerProfile = new Profile();
        $buyerProfile->setName($buyer->getFullname());

        $buyer->addProfile($buyerProfile);

        $location = new Location();
        $location->setName('Default');
        $location->setAddressLine1('250 Main Street');
        $location->setTown('Great Barrington');
        $location->setStateCode('MA');
        $location->setPostalCode('01230');

        $geocoder->geocode($location);

        $buyerProfile->addLocation($location);

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


        $buyer = new User();
        $buyer->setEmail('peter.buyer@example.com');
        $buyer->setFirstname('Peter');
        $buyer->setLastname('Buyer');
        $buyer->setEnabled(true);

        $encoder = $this->container
            ->get('security.encoder_factory')
            ->getEncoder($buyer)
        ;

        $buyer->setPassword($encoder->encodePassword('buyer', $buyer->getSalt()));

        $buyerProfile = new Profile();
        $buyerProfile->setName($buyer->getFullname());

        $buyer->addProfile($buyerProfile);

        $location = new Location();
        $location->setName('Default');
        $location->setAddressLine1('1 Main Street');
        $location->setTown('Sheffield');
        $location->setStateCode('MA');
        $location->setPostalCode('01257');

        $geocoder->geocode($location);

        $buyerProfile->addLocation($location);

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


        $buyer = new User();
        $buyer->setEmail('michael.buyer@example.com');
        $buyer->setFirstname('Michael');
        $buyer->setLastname('Buyer');
        $buyer->setEnabled(true);

        $encoder = $this->container
            ->get('security.encoder_factory')
            ->getEncoder($buyer)
        ;

        $buyer->setPassword($encoder->encodePassword('buyer', $buyer->getSalt()));

        $buyerProfile = new Profile();
        $buyerProfile->setName($buyer->getFullname());

        $buyer->addProfile($buyerProfile);

        $location = new Location();
        $location->setName('Default');
        $location->setAddressLine1('1 Main Street');
        $location->setTown('Lee');
        $location->setStateCode('MA');
        $location->setPostalCode('01238');

        $geocoder->geocode($location);

        $buyerProfile->addLocation($location);

        $manager->persist($buyer);
        $manager->flush();
    }
324415
public function load(ObjectManager $manager)
    {
        $nodeRepository = $this->container->get('open_orchestra_model.repository.node');
        $nodes = $nodeRepository->findBy(array('nodeId' => NodeInterface::ROOT_NODE_ID, 'status.publishedState' => true));
        $updateRoute = $this->container->get('open_orchestra_backoffice.manager.route_document');

        foreach ($nodes as $node) {
            $routes = $updateRoute->createForNode($node);
            foreach ($routes as $route) {
                $manager->persist($route);
            }
        }

        $manager->flush();
    }
218237
public function getManager(?string $name = null) : ObjectManager
    {
        if ($name === null) {
            $name = $this->defaultManager;
        }

        if (! isset($this->managers[$name])) {
            throw new InvalidArgumentException(
                sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name)
            );
        }

        /** @var ObjectManager $objectManager */
        $objectManager = $this->getService($this->managers[$name]);

        return $objectManager;
    }
1169020
private function fixtureObject(array $data): void
    {
        $obj = $this->createNewInstance($data);

        // Sometimes keys are specified in fixtures.
        // We must make sure Doctrine will force them to be saved.
        // Support for non-composite primary keys only.
        // /!\ Be careful, this will override the generator type for ALL objects of the same entity class!
        //     This means that it _may_ break objects for which ids are not provided in the fixtures.
        $metadata = $this->manager->getClassMetadata($this->getEntityClass());
        $primaryKey = $metadata->getIdentifierFieldNames();
        if (1 === \count($primaryKey) && isset($data[$primaryKey[0]])) {
            $metadata->setIdGeneratorType($metadata::GENERATOR_TYPE_NONE);
            $metadata->setIdGenerator(new AssignedGenerator());
        }

        // And finally we persist the item
        $this->manager->persist($obj);

        // If we need to flush it, then we do it too.
        if (
            $this->numberOfIteratedObjects > 0
            && $this->flushEveryXIterations() > 0
            && $this->numberOfIteratedObjects % $this->flushEveryXIterations() === 0
        ) {
            $this->manager->flush();
            if ($this->clearEMOnFlush) {
                $this->manager->clear();
            }
        }

        // If we have to add a reference, we do it
        if ($prefix = $this->getReferencePrefix()) {
            $methodName = $this->getMethodNameForReference();

            $reference = null;

            if (method_exists($obj, $methodName)) {
                $reference = $obj->{$methodName}();
            } elseif (method_exists($obj, '__toString')) {
                $reference = (string) $obj;
            }

            if (!$reference) {
                throw new RuntimeException(sprintf(
                    'If you want to specify a reference with prefix "%s", method "%s" or "%s" must exist in the class, or you can override the "%s" method and add your own.',
                    $prefix, $methodName, '__toString()', 'getMethodNameForReference'
                ));
            }
            $this->addReference($prefix.$reference, $obj);
        }
    }
908557
public function onBeforeAddToManager(Manager $manager)
    {
        /* @var DataObjectScaffolder $owner */
        $owner = $this->owner;
        $memberType = StaticSchema::inst()->typeNameForDataObject(Member::class);
        $instance = $owner->getDataObjectInstance();
        $class = $owner->getDataObjectClass();
        if (!$instance->hasExtension(Versioned::class)) {
            return;
        }
        /* @var ObjectType $rawType */
        $rawType = $owner->scaffold($manager);

        $versionName = $this->createVersionedTypeName($class);
        $coreFieldsFn = $rawType->config['fields'];
        // Create the "version" type for this dataobject. Takes the original fields
        // and augments them with the Versioned_Version specific fields
        $versionType = new ObjectType([
            'name' => $versionName,
            'fields' => function () use ($coreFieldsFn, $manager, $memberType) {
                $coreFields = $coreFieldsFn();
                $versionFields = [
                    'Author' => [
                        'type' => $manager->getType($memberType),
                        'resolve' => function ($obj) {
                            return $obj->Author();
                        }
                    ],
                    'Publisher' => [
                        'type' => $manager->getType($memberType),
                        'resolve' => function ($obj) {
                            return $obj->Publisher();
                        }
                    ],
                    'Published' => [
                        'type' => Type::boolean(),
                        'resolve' => function ($obj) {
                            return $obj->WasPublished;
                        }
                    ],
                    'LiveVersion' => [
                        'type' => Type::boolean(),
                        'resolve' => function ($obj) {
                            return $obj->isLiveVersion();
                        }
                    ],
                    'LatestDraftVersion' => [
                        'type' => Type::boolean(),
                        'resolve' => function ($obj) {
                            return $obj->isLatestDraftVersion();
                        }
                    ],
                ];
                // Remove this recursive madness.
                unset($coreFields['Versions']);

                return array_merge($coreFields, $versionFields);
            }
        ]);

        $manager->addType($versionType, $versionName);

        // With the version type in the manager now, add the versioning fields to the dataobject type
        $owner
            ->addFields(['Version'])
            ->nestedQuery('Versions', new ReadVersions($class, $versionName));
    }
291225
public function load(array $fixturesFiles, array $parameters = [], array $objects = [], PurgeMode $purgeMode = null): array
    {
        $this->logger->info('Loading fixtures.');

        return $this->filesLoader->loadFiles($fixturesFiles, $parameters, $objects)->getObjects();
    }
438081
public function load(ObjectManager $manager)
    {
        // resource type attributes : name, listable, navigable, class
        $resourceTypes = array(
            array('file', true),
            array('directory', true),
            array('text', true),
            array('resource_shortcut', false),
            array('activity', true)
        );

        $types[] = array();

        foreach ($resourceTypes as $attributes) {
            $type = new ResourceType();
            $type->setName($attributes[0]);
            $type->setExportable($attributes[1]);
            $manager->persist($type);
            $this->container->get('claroline.manager.mask_manager')->addDefaultPerms($type);
            $types[$attributes[0]] = $type;
        }

        //add special actions.
        $composeDecoder = new MaskDecoder();
        $composeDecoder->setValue(pow(2, 10));
        $composeDecoder->setName('compose');
        $composeDecoder->setResourceType($types['activity']);
        $manager->persist($composeDecoder);

        $activityMenu = new MenuAction();
        $activityMenu->setName('compose');
        $activityMenu->setAsync(false);
        $activityMenu->setIsCustom(true);
        $activityMenu->setValue(pow(2, 10));
        $activityMenu->setResourceType($types['activity']);
        $activityMenu->setIsForm(false);
        $manager->persist($activityMenu);

        $updateFile = new MenuAction();
        $updateFile->setName('update_file');
        $updateFile->setAsync(true);
        $updateFile->setIsCustom(true);
        $updateFile->setIsForm(false);
        $updateFile->setResourceType($types['file']);
        //16 is default for edit
        $updateFile->setValue(16);
        $manager->persist($updateFile);

        $fileAction = new ActivityRuleAction();
        $fileAction->setAction('resource-read');
        $fileAction->setResourceType($types['file']);
        $manager->persist($fileAction);

        $textAction = new ActivityRuleAction();
        $textAction->setAction('resource-read');
        $textAction->setResourceType($types['text']);
        $manager->persist($textAction);

        $badgeAwardAction = new ActivityRuleAction();
        $badgeAwardAction->setAction('badge-awarding');
        $manager->persist($badgeAwardAction);
    }
1365146
public static function loadListeners($manager = null, $scope = null) {
		if (!($manager instanceof CakeEventManager)) {
			$manager = CakeEventManager::instance();
		}

		empty($manager::$loadedListeners['Common'])
		&& $manager::$loadedListeners['Common'] = new CommonEventListener();

		(empty($manager::$loadedScopes['Common']) || !in_array($scope, (array) $manager::$loadedScopes['Common']))
		&& $manager::$loadedScopes['Common'][] = $scope
		&& CommonEventManager::attachByScope($manager::$loadedListeners['Common'], $manager, $scope);

		$manager::$implementedEvents['Common'] = array_keys($manager::$loadedListeners['Common']->implementedEvents());

		foreach (CakePlugin::loaded() as $plugin) {
			if (isset($manager::$loadedListeners[$plugin])) {
				if (
					$manager::$loadedListeners[$plugin]
					&& !empty($scope)
					&& !in_array($scope, (array) $manager::$loadedScopes[$plugin])
				) {
					self::$loadedScopes[$plugin][] = $scope;
					CommonEventManager::attachByScope($manager::$loadedListeners[$plugin], $manager, $scope);
				}
				continue;
			}

			$class = $plugin . 'EventListener';

			if (ClassRegistry::isKeySet($class)) {
				$manager::$loadedListeners[$plugin] = ClassRegistry::getObject($class);
			} else if (file_exists(CakePlugin::path($plugin) . 'Event' . DS . $class . '.php')) {
				App::uses($class, $plugin . '.Event');
				$manager::$loadedListeners[$plugin] = new $class();
			} else {
				$manager::$loadedListeners[$plugin] = false;
				continue;
			}

			$manager::$loadedScopes[$plugin] = array();
			$manager::$implementedEvents[$plugin] = array_keys($manager::$loadedListeners[$plugin]->implementedEvents());

			if (empty($scope)) {
				$manager->attach($manager::$loadedListeners[$plugin]);
			} else if (!in_array($scope, $manager::$loadedScopes[$plugin])) {
				$manager::$loadedScopes[$plugin][] = $scope;
				CommonEventManager::attachByScope($manager::$loadedListeners[$plugin], $manager, $scope);
			}
		}

		if (!Reveal::is('Page.test') && !isset($manager::$loadedListeners['App'])) {
			if (file_exists(APP . 'Event' . DS . 'AppEventListener.php')) {
				App::uses('AppEventListener', 'Event');
				$manager::$loadedListeners['App'] = new AppEventListener();
				$manager::$loadedScopes['App'] = array();
				$manager::$implementedEvents['App'] = array_keys($manager::$loadedListeners['App']->implementedEvents());
				if (empty($scope)) {
					$manager->attach($manager::$loadedListeners['App']);
				} else if (!in_array($scope, $manager::$loadedScopes['App'])) {
					self::$loadedScopes['App'][] = $scope;
					CommonEventManager::attachByScope($manager::$loadedListeners['App'], $manager, $scope);
				}
			}
		} else if (
			isset($manager::$loadedListeners['App'])
			&& $manager::$loadedListeners['App']
			&& !empty($scope)
			&& !in_array($scope, $manager::$loadedScopes['App'])
		) {
			$manager::$loadedScopes['App'][] = $scope;
			CommonEventManager::attachByScope($manager::$loadedListeners['App'], $manager, $scope);
		}

		return $manager;
	}
74176
public static function getInstance(ObjectConfigInterface $config, ObjectManagerInterface $manager)
    {
        $name = $config->object_identifier->name;

        if(StringInflector::isSingular($name)) {
            $class = __NAMESPACE__.'\ModelEntityRow';
        } else {
            $class = __NAMESPACE__.'\ModelEntityRowset';
        }

        $instance = new $class($config);
        return $instance;
    }