当前位置: 首页>>代码示例>>PHP>>正文


PHP ManagerRegistry::getManagers方法代码示例

本文整理汇总了PHP中Doctrine\Common\Persistence\ManagerRegistry::getManagers方法的典型用法代码示例。如果您正苦于以下问题:PHP ManagerRegistry::getManagers方法的具体用法?PHP ManagerRegistry::getManagers怎么用?PHP ManagerRegistry::getManagers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\Common\Persistence\ManagerRegistry的用法示例。


在下文中一共展示了ManagerRegistry::getManagers方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cleanUp

 public function cleanUp()
 {
     foreach ($this->managerRegistry->getManagers() as $name => $manager) {
         $this->logger->debug('Clear EntityManager', ['entity_manager' => $name]);
         $manager->clear();
     }
 }
开发者ID:cmodijk,项目名称:LongRunning,代码行数:7,代码来源:ClearEntityManagers.php

示例2: warmUp

 /**
  * {@inheritdoc}
  */
 public function warmUp($cacheDir)
 {
     $helper = new UniqueNodeTypeHelper();
     foreach ($this->registry->getManagers() as $documentManager) {
         $helper->checkNodeTypeMappings($documentManager);
     }
 }
开发者ID:pamil,项目名称:DoctrinePHPCRBundle,代码行数:10,代码来源:UniqueNodeTypeCacheWarmer.php

示例3: boot

 /**
  * Boot the extensions
  */
 public function boot()
 {
     foreach ($this->registry->getManagers() as $connection => $em) {
         foreach ($this->extensions as $extension) {
             if ($this->notBootedYet($connection, $extension)) {
                 $this->bootExtension($connection, $extension, $em, $em->getEventManager(), $em->getConfiguration());
             }
         }
     }
 }
开发者ID:Devitek,项目名称:orm,代码行数:13,代码来源:ExtensionManager.php

示例4: boot

 /**
  * Boot the extensions
  */
 public function boot()
 {
     foreach ($this->registry->getManagers() as $em) {
         $this->em = $em;
         $this->evm = $this->em->getEventManager();
         $this->metadata = $this->em->getConfiguration();
         $this->reader = $this->driverChain->getReader();
         foreach ($this->extensions as $extension) {
             $this->bootExtension($extension);
         }
     }
 }
开发者ID:vyolla,项目名称:orm,代码行数:15,代码来源:ExtensionManager.php

示例5: process

 /**
  * {@inheritdoc}
  */
 public function process(Message $message, array $options)
 {
     $result = $this->processor->process($message, $options);
     foreach ($this->managerRegistry->getManagers() as $managerName => $manager) {
         if (method_exists($manager, 'isOpen') && !$manager->isOpen()) {
             $this->managerRegistry->resetManager($managerName);
             continue;
         }
         $manager->clear();
     }
     return $result;
 }
开发者ID:behinddesign,项目名称:swarrot,代码行数:15,代码来源:ObjectManagerProcessor.php

示例6: cleanUp

 public function cleanUp()
 {
     foreach ($this->managerRegistry->getManagers() as $name => $manager) {
         if (!$manager instanceof EntityManager) {
             continue;
         }
         if (!$manager->isOpen()) {
             $this->logger->debug('Reset closed EntityManager', ['entity_manager' => $name]);
             $this->managerRegistry->resetManager($name);
         }
     }
 }
开发者ID:cmodijk,项目名称:LongRunning,代码行数:12,代码来源:ResetClosedEntityManagers.php

示例7: isKnownEntityClassNamespace

 /**
  * Checks whether the given namespace is registered in the Doctrine
  *
  * @param string $namespace
  * @return bool
  */
 public function isKnownEntityClassNamespace($namespace)
 {
     foreach (array_keys($this->doctrine->getManagers()) as $name) {
         $manager = $this->doctrine->getManager($name);
         if ($manager instanceof EntityManager) {
             $namespaces = $manager->getConfiguration()->getEntityNamespaces();
             if (in_array($namespace, $namespaces, true)) {
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:xamin123,项目名称:platform,代码行数:19,代码来源:EntityClassResolver.php

示例8: supports

 /**
  * {@inheritdoc}
  */
 function supports(ParamConverter $configuration)
 {
     if (null === $this->registry || !count($this->registry->getManagers())) {
         return false;
     }
     if (null === $configuration->getClass()) {
         return false;
     }
     $em = $this->registry->getManagerForClass($configuration->getClass());
     if ('SensorBundle\\Entity\\Measure' !== $em->getClassMetadata($configuration->getClass())->getName()) {
         return false;
     }
     return true;
 }
开发者ID:rybus,项目名称:mogette-ui,代码行数:17,代码来源:SensorByPeriodConverter.php

示例9: boot

 /**
  * Boot the extensions
  */
 public function boot()
 {
     foreach ($this->registry->getManagers() as $em) {
         $this->em = $em;
         $this->evm = $this->em->getEventManager();
         $this->metadata = $this->em->getConfiguration();
         $this->reader = $this->driverChain->getReader();
         $hash = spl_object_hash($em);
         if (!isset($this->subscribedExtensions[$hash])) {
             $this->subscribedExtensions[$hash] = [];
         }
         foreach ($this->extensions as $extension) {
             $this->bootExtension($extension);
         }
     }
 }
开发者ID:jee7,项目名称:orm,代码行数:19,代码来源:ExtensionManager.php

示例10: getMetadata

 protected function getMetadata($class)
 {
     if (array_key_exists($class, $this->cache)) {
         return $this->cache[$class];
     }
     $this->cache[$class] = null;
     foreach ($this->registry->getManagers() as $name => $em) {
         try {
             return $this->cache[$class] = array($em->getClassMetadata($class), $name);
         } catch (MappingException $e) {
             // not an entity or mapped super class
         } catch (LegacyMappingException $e) {
             // not an entity or mapped super class, using Doctrine ORM 2.2
         }
     }
 }
开发者ID:sgh1986915,项目名称:symfony-tsk,代码行数:16,代码来源:EntityHiddenType.php

示例11: boot

 /**
  * Boot the extensions
  */
 public function boot()
 {
     foreach ($this->registry->getManagers() as $em) {
         $this->em = $em;
         $this->chain = new MappingDriverChain();
         $this->evm = $this->em->getEventManager();
         $this->metadata = $this->em->getConfiguration();
         $this->reader = method_exists($this->metadata->getMetadataDriverImpl(), 'getReader') ? $this->metadata->getMetadataDriverImpl()->getReader() : false;
         if ($this->gedmo['enabled']) {
             $this->bootGedmoExtensions($this->gedmo['namespace'], $this->gedmo['all']);
         }
         foreach ($this->extensions as $extenion) {
             $this->bootExtension($extenion);
         }
     }
 }
开发者ID:rosstuck,项目名称:Laravel-Doctrine,代码行数:19,代码来源:ExtensionManager.php

示例12: fromRegistry

 /**
  * Create a driver from a Doctrine registry
  *
  * @param ManagerRegistry $registry
  * @return DriverInterface
  */
 public static function fromRegistry(ManagerRegistry $registry)
 {
     $drivers = array();
     foreach ($registry->getManagers() as $manager) {
         $drivers[] = self::fromManager($manager);
     }
     return new DriverChain($drivers);
 }
开发者ID:prezent,项目名称:doctrine-translatable,代码行数:14,代码来源:DoctrineAdapter.php

示例13: write

 /**
  * {@inheritdoc}
  */
 public function write(array $items)
 {
     if (is_array(reset($items))) {
         $items = call_user_func_array('array_merge', $items);
     }
     foreach ($items as $item) {
         if (!is_object($item)) {
             throw new \InvalidArgumentException(sprintf('Expecting item of type object, got "%s"', gettype($item)));
         }
         $this->registry->getManagerForClass(get_class($item))->persist($item);
         $this->incrementCount($item);
     }
     foreach ($this->registry->getManagers() as $manager) {
         $manager->flush();
     }
     $this->cacheClearer->clear();
 }
开发者ID:jacko972,项目名称:pim-community-dev,代码行数:20,代码来源:Writer.php

示例14: boot

 /**
  * Boot the service provider
  *
  * @param ManagerRegistry $registry
  */
 public function boot(ManagerRegistry $registry)
 {
     foreach ($registry->getManagers() as $manager) {
         $chain = $manager->getConfiguration()->getMetadataDriverImpl();
         $reader = $chain->getReader();
         if ($this->app->make('config')->get('doctrine.gedmo.all_mappings', false)) {
             DoctrineExtensions::registerMappingIntoDriverChainORM($chain, $reader);
         } else {
             DoctrineExtensions::registerAbstractMappingIntoDriverChainORM($chain, $reader);
         }
     }
 }
开发者ID:jee7,项目名称:extensions,代码行数:17,代码来源:GedmoExtensionsServiceProvider.php

示例15: supports

 public function supports(ConfigurationInterface $configuration)
 {
     // if there is no manager, this means that only Doctrine DBAL is configured
     if (null === $this->registry || !count($this->registry->getManagers())) {
         return false;
     }
     if (null === $configuration->getClass()) {
         return false;
     }
     $options = $this->getOptions($configuration);
     // Doctrine Entity?
     return !$this->registry->getManager($options['entity_manager'])->getMetadataFactory()->isTransient($configuration->getClass());
 }
开发者ID:rrehbeindoi,项目名称:SensioFrameworkExtraBundle,代码行数:13,代码来源:DoctrineParamConverter.php


注:本文中的Doctrine\Common\Persistence\ManagerRegistry::getManagers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。