@inheritdoc

@param string $objectManagerServiceName

@return boolean
506704
public function hasNamespacesByObjectManager($objectManagerServiceName)
    {
        if (array_key_exists($objectManagerServiceName, $this->namespacesByObjectManagerCache)) {
            return false !== $this->namespacesByObjectManagerCache[$objectManagerServiceName];
        }

        if (!$this->isValidDoctrineOrmModuleConfig()) {
            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
            return false;
        }

        if (0 !== strpos($objectManagerServiceName, static::DOCTRINE_PREFIX)) {
            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
            return false;
        }

        $objectManagerName = substr($objectManagerServiceName, 23);

        $doctrineConfig = $this->getDoctrineConfig();

        if (!array_key_exists($objectManagerName, $doctrineConfig['entitymanager'])) {
            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
            return false;
        }

        $omConfig = $doctrineConfig['entitymanager'][$objectManagerName];

        if (!is_array($omConfig) || !array_key_exists('configuration', $omConfig) || !is_string($omConfig['configuration'])) {
            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
            return false;
        }

        $confName = $omConfig['configuration'];

        if (!array_key_exists($confName, $doctrineConfig['configuration']) || !is_array($doctrineConfig['configuration'][$confName])) {
            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
            return false;
        }

        $omConfiguration = $doctrineConfig['configuration'][$confName];

        if (!array_key_exists('driver', $omConfiguration) || !is_string($omConfiguration['driver'])) {
            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
            return false;
        }

        $driverName = $omConfiguration['driver'];

        if (!array_key_exists($driverName, $doctrineConfig['driver']) || !is_array($doctrineConfig['driver'][$driverName])) {
            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
            return false;
        }

        $driverConfig = $doctrineConfig['driver'][$driverName];

        if (!array_key_exists('drivers', $driverConfig) || !is_array($driverConfig['drivers'])) {
            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
            return false;
        }

        $this->namespacesByObjectManagerCache[$objectManagerServiceName] = $this->buildIndexNamespaces($driverConfig['drivers']);

        return false !== $this->namespacesByObjectManagerCache[$objectManagerServiceName];
    }
776452
public function loadEntityMap($objectManagerName)
    {
        $key = $this->getCacheKeyForObjectManagerName($objectManagerName);

        $cache = $this->getCache();

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

        return $cache->fetch($key);
    }
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();
    }
797629
protected function getObjectReferencesByIds(ObjectManager $objectManager, $className, array $ids)
    {
        $entities = [];

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

        return $entities;
    }
191807
public function load(ObjectManager $manager)
    {
        $exchange = new Exchange();
        $exchange->setName('The Harvest Cloud');

        $manager->persist($exchange);
        $manager->flush();
    }
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);
    }
682520
public static function initializeStreamWrapper($objectManager)
    {
        $streamWrapperClassNames = static::getStreamWrapperImplementationClassNames($objectManager);
        /** @var StreamWrapperInterface $streamWrapperClassName */
        foreach ($streamWrapperClassNames as $streamWrapperClassName) {
            $scheme = $streamWrapperClassName::getScheme();
            if (in_array($scheme, stream_get_wrappers())) {
                stream_wrapper_unregister($scheme);
            }
            stream_wrapper_register($scheme, StreamWrapperAdapter::class);
            static::registerStreamWrapper($scheme, $streamWrapperClassName);
        }
    }
591724
public function load(ObjectManager $em) {
    foreach ($this->examples as $list) {
      list($example, $context) = $list;

      $fixture = new NestedSetFixture($example, $context);
      $fixture->load($em);
    }
  }
1340342
private function isValidObjectClass($objectType)
    {
        //====================================================================//
        // Check if Object Manager is Overriden
        if (Splash::local() instanceof ObjectsProviderInterface) {
            //====================================================================//
            // Retrieve Object Manager ClassName
            $className = get_class(Splash::local()->object($objectType));
        } else {
            $className = SPLASH_CLASS_PREFIX.'\\Objects\\'.$objectType;
        }
        //====================================================================//
        // Verify Splash Local Core Class Exists
        if (false == class_exists($className)) {
            return Splash::log()->err(Splash::trans('ErrLocalClass', $objectType));
        }

        //====================================================================//
        // Verify Local Object Core Class Functions Exists
        //====================================================================//

        //====================================================================//
        // Read Object Disable Flag
        if (false == $this->isValidLocalFunction('getIsDisabled', $className)) {
            return false;
        }
        if (Splash::configurator()->isDisabled($objectType, $className::getIsDisabled())) {
            return false;
        }

        //====================================================================//
        // Verify Local Object Class Implements ObjectInterface
        return is_subclass_of($className, ObjectInterface::class);
    }
38576
public static function getAllProcessors($objectManager)
    {
        /** @var ReflectionService $reflectionService */
        $reflectionService = $objectManager->get(ReflectionService::class);
        $processorClassNames = $reflectionService->getAllImplementationClassNamesForInterface(IndexSettingProcessorInterface::class);

        $processors = [];
        foreach ($processorClassNames as $processorClassName) {
            $processors[$processorClassName] = [
                'priority' => $processorClassName::getPriority(),
                'className' => $processorClassName
            ];
        }

        return array_reverse(
            (new PositionalArraySorter($processors, 'priority'))->toArray()
        );
    }
396177
public static function getDataSources($objectManager)
    {
        $reflectionService = $objectManager->get(ReflectionService::class);

        $dataSources = [];
        $dataSourceClassNames = $reflectionService->getAllImplementationClassNamesForInterface(DataSourceInterface::class);
        /** @var $dataSourceClassName DataSourceInterface */
        foreach ($dataSourceClassNames as $dataSourceClassName) {
            $identifier = $dataSourceClassName::getIdentifier();
            if (isset($dataSources[$identifier])) {
                throw new NeosException(sprintf('Data source with identifier "%s" is already defined in class %s.', $identifier, $dataSourceClassName), 1414088185);
            }
            $dataSources[$identifier] = $dataSourceClassName;
        }

        return $dataSources;
    }
656739
public function injectObjectManager(ObjectManagerInterface $objectManager)
    {
        $this->objectManager = $objectManager;
        /** @var CacheManager $cacheManager */
        $cacheManager = $this->objectManager->get(CacheManager::class);
        $this->methodPermissionCache = $cacheManager->getCache('Flow_Security_Authorization_Privilege_Method');
        $this->runtimeExpressionEvaluator = $this->objectManager->get(RuntimeExpressionEvaluator::class);
    }
31926
public function getObjectManagerName()
    {
        if (!is_string($this->objectManagerName)) {
            $errMsg = 'Invalid object manager name. Manager name not string.';
            throw new Exception\InvalidObjectManagerNameException($errMsg);
        }
        return $this->objectManagerName;
    }
5328
protected static function detectPlugins(ObjectManagerInterface $objectManager)
    {
        $pluginConfigurations = [];
        $classNames = $objectManager->get(ReflectionService::class)->getAllImplementationClassNamesForInterface(NodeCommandControllerPluginInterface::class);
        foreach ($classNames as $className) {
            $pluginConfigurations[$className] = [
                'object' => $objectManager->get($objectManager->getObjectNameByClassName($className))
            ];
        }
        return $pluginConfigurations;
    }
782058
protected function isOrganizationManager(TokenInterface $token, $object)
    {
        $adminOrganizations = $token->getUser()->getAdministratedOrganizations();
        $objectOrganizations = $object->getOrganizations();

        foreach ($adminOrganizations as $adminOrganization) {
            foreach ($objectOrganizations as $objectOrganization) {
                if ($objectOrganization === $adminOrganization) {
                    return true;
                }
            }
        }

        return false;
    }
469370
public function findRemovedByObjectOrSender(
        User $user,
        $objectOrSenderUsernameSearch,
        $executeQuery = true
    )
    {
        $dql = "
            SELECT um, m, u
            FROM Claroline\MessageBundle\Entity\UserMessage um
            JOIN um.user u
            JOIN um.message m
            WHERE u.id = {$user->getId()}
            AND um.isRemoved = true
            AND (
                UPPER(m.object) LIKE :search
                OR UPPER(m.senderUsername) LIKE :search
            )
            GROUP BY m
            ORDER BY m.date DESC
        ";
        $query = $this->_em->createQuery($dql);
        $searchParameter = '%' . strtoupper($objectOrSenderUsernameSearch) . '%';
        $query->setParameter('search', $searchParameter);

        return $executeQuery ? $query->getResult() : $query;
    }
718136
protected function isEntityManager(ClassNode $classNode): bool
    {
        $className = $this->getClassName($classNode);

        if (preg_match(self::PATTERN_ENTITY_MANAGER, $className)) {
            return true;
        }

        return false;
    }