Проверяет есть ли в кеше карта сущностей для заданного ObjectManager

@param $objectManagerName

@return bool
503473
public function hasEntityMap($objectManagerName)
    {
        $key = $this->getCacheKeyForObjectManagerName($objectManagerName);

        return $this->getCache()->contains($key);
    }
1171255
public function getRepository(EntityManagerInterface $entityManager, $entityName)
    {
        return $this->repositorySubManager->get($this->entityRepositoryMapping->getRepositoryByEntity($entityName));
    }
1050280
public function getFormConfiguration($objectName, $formName)
    {
        $modelConfiguration = $this->getModelConfiguration($objectName);
        if (isset($modelConfiguration['forms'][$formName])) {
            $formConfiguration = $modelConfiguration['forms'][$formName];
            foreach ($formConfiguration['fields'] as $i => $formField) {
                $fieldConfiguration = $this->getField($objectName, $formField['name'], false);
                if (isset($fieldConfiguration['form_defaults'])) {
                    $formConfiguration['fields'][$i] = array_replace_recursive($fieldConfiguration['form_defaults'], $formField);
                }
            }

            usort($formConfiguration['fields'], array($this, 'sortByLocation'));

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

        $user = new User();
        $user->setEmail('jon.seller@example.com');
        $user->setFirstname('Jon');
        $user->setLastname('Seller');
        $user->setEnabled(true);

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

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

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

        $user->addProfile($profile);

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

        $geocoder->geocode($location);

        $profile->addLocation($location);

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

        $this->addReference('jon-seller', $profile);


        $user = new User();
        $user->setEmail('tom.seller@example.com');
        $user->setFirstname('Tom');
        $user->setLastname('Seller');
        $user->setEnabled(true);

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

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

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

        $user->addProfile($profile);

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

        $geocoder->geocode($location);

        $profile->addLocation($location);

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

        $this->addReference('tom-seller', $profile);


        $user = new User();
        $user->setEmail('stephen.seller@example.com');
        $user->setFirstname('Stephen');
        $user->setLastname('Seller');
        $user->setEnabled(true);

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

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

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

        $user->addProfile($profile);

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

        $geocoder->geocode($location);

        $profile->addLocation($location);

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

        $this->addReference('stephen-seller', $profile);


        $user = new User();
        $user->setEmail('jo.seller@example.com');
        $user->setFirstname('Jo');
        $user->setLastname('Seller');
        $user->setEnabled(true);

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

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

        $profile = new Profile();
        $profile->setName($user->getFullname());
        $profile->setSystemSellerStatus(Profile::STATUS_ENABLED);
        $profile->setSellerStatus(Profile::STATUS_ACTIVE);
        $profile->setSlug('joseller');

        $user->addProfile($profile);

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

        $geocoder->geocode($location);

        $profile->addLocation($location);

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

        $this->addReference('jo-seller', $profile);


        $user = new User();
        $user->setEmail('mike.seller@example.com');
        $user->setFirstname('Mike');
        $user->setLastname('Seller');
        $user->setEnabled(true);

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

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

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

        $user->addProfile($profile);

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

        $geocoder->geocode($location);

        $profile->addLocation($location);

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

        $this->addReference('mike-seller', $profile);


        $user = new User();
        $user->setEmail('sterling.seller@example.com');
        $user->setFirstname('Sterling');
        $user->setLastname('Seller');
        $user->setEnabled(true);

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

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

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

        $user->addProfile($profile);

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

        $geocoder->geocode($location);

        $profile->addLocation($location);

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

        $this->addReference('sterling-seller', $profile);
    }
362219
public function getModelConfiguration($objectName)
    {
        if (isset($this->configuration[$objectName])) {
            $modelConfiguration = $this->configuration[$objectName];
            $modelConfiguration['__object_name'] = $objectName;
            if (isset($modelConfiguration['fields']) === false) {
                $modelConfiguration['fields'] = array();
            }

            return $modelConfiguration;
        }
    }
324745
public function load(ObjectManager $manager)
    {
        $group1 = $this->createGroup($manager, 'Administrators', array(
            $this->getReference(RoleFixtures::REFERENCE_PERMISSIONMANAGER_ROLE),
            $this->getReference(RoleFixtures::REFERENCE_ADMIN_ROLE),
        ));

        $group2 = $this->createGroup($manager, 'Guests', array(
            $this->getReference(RoleFixtures::REFERENCE_GUEST_ROLE),
        ));

        $group3 = $this->createGroup($manager, 'Super administrators', array(
            $this->getReference(RoleFixtures::REFERENCE_PERMISSIONMANAGER_ROLE),
            $this->getReference(RoleFixtures::REFERENCE_ADMIN_ROLE),
            $this->getReference(RoleFixtures::REFERENCE_SUPERADMIN_ROLE),
        ));

        $manager->flush();

        $this->addReference(self::REFERENCE_ADMINS_GROUP, $group1);
        $this->addReference(self::REFERENCE_GUESTS_GROUP, $group2);
        $this->addReference(self::REFERENCE_SUPERADMINS_GROUP, $group3);
    }
1165062
public function buildEntityMapByObjectManagerName($objectManagerName)
    {
        $entityClassNames = $this->getEntityClassNamesByObjectManagerName($objectManagerName);

        $listEntityInterfaces = $this->buildListEntityInterfaces($entityClassNames);

        $map = [];

        $entityManager = $this->getEntityManager();
        foreach ($listEntityInterfaces as $currentInterface) {
            if ($entityManager->hasEntityClassByInterface($currentInterface)) {
                $map[$currentInterface] = $entityManager->getEntityClassByInterface($currentInterface);
            }
        }

        return $map;
    }
815517
public function load(ObjectManager $manager)
    {
        /**
         * @var ObjectDirector $menuNodeDirector
         */
        $menuNodeDirector = $this->getDirector('menu_node');

        $menuNodeHim = $menuNodeDirector
            ->create()
            ->setName('him')
            ->setCode('him')
            ->setUrl('elcodi.dev/him')
            ->setActiveUrls([])
            ->setEnabled(true);

        $menuNodeHer = $menuNodeDirector
            ->create()
            ->setName('her')
            ->setCode('her')
            ->setUrl('elcodi.dev/her')
            ->setActiveUrls(
                [
                    'her_products_list_route',
                    'her_offers_list_route',
                ]
            )
            ->setEnabled(true);

        $menuNodeVogue = $menuNodeDirector
            ->create()
            ->setName('vogue')
            ->setCode('vogue')
            ->setEnabled(true)
            ->setActiveUrls([])
            ->addSubnode($menuNodeHim)
            ->addSubnode($menuNodeHer);

        $menuNodeDirector->save($menuNodeVogue);
        $this->addReference('menu-node-him', $menuNodeHim);
        $this->addReference('menu-node-her', $menuNodeHer);
        $this->addReference('menu-node-vogue', $menuNodeVogue);
    }
293130
public static function getPolyTypeObjectValidatorImplementationClassNames($objectManager)
    {
        $reflectionService = $objectManager->get(ReflectionService::class);
        $result = $reflectionService->getAllImplementationClassNamesForInterface(Validator\PolyTypeObjectValidatorInterface::class);
        return $result;
    }
940148
public function getObjectManager()
    {
        $manager = $this->registry->getManagerForClass($this->class);

        if (!$manager) {
            throw new \RuntimeException(sprintf(
                'Unable to find the mapping information for the class %s.'
                .' Please check the `auto_mapping` option'
                .' (http://symfony.com/doc/current/reference/configuration/doctrine.html#configuration-overview)'
                .' or add the bundle to the `mappings` section in the doctrine configuration.',
                $this->class
            ));
        }

        return $manager;
    }
665742
public function getManager($entityName)
    {
    	$entityName = ltrim($entityName, '\\');

    	if (isset($this->repositories[$entityName])) {
    		return $this->repositories[$entityName];
    	}
    	$repositoryClassName = ltrim($entityName::MANAGER_CLASS_NAME, '\\');

    	$repository = new $repositoryClassName($this,$entityName);

    	$this->repositories[$entityName] = $repository;

    	return $repository;
    }
441476
public function getObjectManagerNameByClassName($className)
    {
        $realClass = ClassUtils::getRealClass($className);
        if (false === $this->hasObjectManagerNameByClassName($realClass)) {
            $errMsg = sprintf('Failed to get the manager\'s name for class %s', $realClass);
            throw new Exception\ErrorBuildObjectManagerNameException($errMsg);
        }

        return $this->classNameToObjectManagerName[$realClass];
    }
109670
public function unload($objectName)
    {
        if (empty($this->_loaded[$objectName])) {
            list($plugin, $objectName) = pluginSplit($objectName);
            $this->_throwMissingClassError($objectName, $plugin);
        }

        $object = $this->_loaded[$objectName];
        if ($this instanceof EventDispatcherInterface && $object instanceof EventListenerInterface) {
            $this->getEventManager()->off($object);
        }
        unset($this->_loaded[$objectName]);

        return $this;
    }
1062889
public function load(ObjectManager $manager)
    {
        /**
         * @var ObjectDirector $storeDirector
         */
        $storeDirector = $this->getDirector('store');
        $address = $this->getReference('address-sant-celoni');
        $language = $this->getReference('language-es');
        $currency = $this->getReference('currency-euro');

        $store = $storeDirector
            ->create()
            ->setName('Store')
            ->setLeitmotiv('Uh yes, I don\'t know what... this is a store...')
            ->setEmail('email@email.com')
            ->setTracker('123456')
            ->setTemplate('fhsjkhfjklsa')
            ->setUseStock(true)
            ->setAddress($address)
            ->setDefaultLanguage($language)
            ->setDefaultCurrency($currency);

        $storeDirector->save($store);
        $this->setReference('store', $store);
    }
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);
    }
797629
protected function getObjectReferencesByIds(ObjectManager $objectManager, $className, array $ids)
    {
        $entities = [];

        foreach ($ids as $id) {
            /** @var EntityManager $objectManager */
            $entities[] = $objectManager->getReference($className, $id);
        }

        return $entities;
    }
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();
    }