當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AnnotationReader::setIgnoreNotImportedAnnotations方法代碼示例

本文整理匯總了PHP中Doctrine\Common\Annotations\AnnotationReader::setIgnoreNotImportedAnnotations方法的典型用法代碼示例。如果您正苦於以下問題:PHP AnnotationReader::setIgnoreNotImportedAnnotations方法的具體用法?PHP AnnotationReader::setIgnoreNotImportedAnnotations怎麽用?PHP AnnotationReader::setIgnoreNotImportedAnnotations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine\Common\Annotations\AnnotationReader的用法示例。


在下文中一共展示了AnnotationReader::setIgnoreNotImportedAnnotations方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 public function setUp()
 {
     if (version_compare(\Doctrine\Common\Version::VERSION, '2.1.0RC4-DEV', '>=')) {
         $this->markTestSkipped('Doctrine common is 2.1.0RC4-DEV version, skipping.');
     } else {
         if (version_compare(\Doctrine\Common\Version::VERSION, '2.1.0-BETA3-DEV', '>=')) {
             $reader = new AnnotationReader();
             $reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\');
             $reader->setIgnoreNotImportedAnnotations(true);
             $reader->setAnnotationNamespaceAlias('Gedmo\\Mapping\\Annotation\\', 'gedmo');
             $reader->setEnableParsePhpImports(false);
             $reader->setAutoloadAnnotations(true);
             $reader = new CachedReader(new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache());
         } else {
             $reader = new AnnotationReader();
             $reader->setAutoloadAnnotations(true);
             $reader->setAnnotationNamespaceAlias('Gedmo\\Mapping\\Annotation\\', 'gedmo');
             $reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\');
         }
     }
     $config = new \Doctrine\ORM\Configuration();
     $config->setProxyDir(TESTS_TEMP_DIR);
     $config->setProxyNamespace('Gedmo\\Mapping\\Proxy');
     $config->setMetadataDriverImpl(new AnnotationDriver($reader));
     $conn = array('driver' => 'pdo_sqlite', 'memory' => true);
     //$config->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger());
     $evm = new \Doctrine\Common\EventManager();
     $this->timestampable = new \Gedmo\Timestampable\TimestampableListener();
     $evm->addEventSubscriber($this->timestampable);
     $this->em = \Doctrine\ORM\EntityManager::create($conn, $config, $evm);
     $schemaTool = new \Doctrine\ORM\Tools\SchemaTool($this->em);
     $schemaTool->dropSchema(array());
     $schemaTool->createSchema(array($this->em->getClassMetadata(self::ARTICLE)));
 }
開發者ID:robertowest,項目名稱:CuteFlow-V4,代碼行數:34,代碼來源:CompatibilityMappingTest.php

示例2: create

 public static function create(IContainer $context)
 {
     $loaders = array();
     $context = new ValidatorContext();
     AnnotationRegistry::registerAutoloadNamespaces(array('\\Doctrine\\ORM\\Mapping\\', '\\Symfony\\Component\\Validator\\Constraints\\'));
     $annotationReader = new AnnotationReader();
     $annotationReader->setIgnoreNotImportedAnnotations(true);
     $loader = new AnnotationLoader($annotationReader);
     $context->setClassMetadataFactory(new ClassMetadataFactory($loader));
     $context->setConstraintValidatorFactory(new ConstraintValidatorFactory());
     $factory = new SymfonyValidatorFactory($context);
     return $factory->getValidator();
 }
開發者ID:bazo,項目名稱:Tatami,代碼行數:13,代碼來源:ValidatorFactory.php

示例3: newDefaultAnnotationDriver

 /**
  * Add a new default annotation driver with a correctly configured annotation reader.
  * 
  * @param array $paths
  * @return Mapping\Driver\AnnotationDriver
  */
 public function newDefaultAnnotationDriver($paths = array())
 {
     if (version_compare(\Doctrine\Common\Version::VERSION, '3.0.0-DEV', '>=')) {
         // Register the ORM Annotations in the AnnotationRegistry
         AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');
         $reader = new AnnotationReader();
         $reader = new \Doctrine\Common\Annotations\CachedReader($reader, new ArrayCache());
     } else {
         if (version_compare(\Doctrine\Common\Version::VERSION, '2.1.0-DEV', '>=')) {
             // Register the ORM Annotations in the AnnotationRegistry
             AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');
             $reader = new AnnotationReader();
             $reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\');
             $reader->setIgnoreNotImportedAnnotations(true);
             $reader->setEnableParsePhpImports(false);
             $reader = new \Doctrine\Common\Annotations\CachedReader(new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache());
         } else {
             $reader = new AnnotationReader();
             $reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\');
         }
     }
     return new AnnotationDriver($reader, (array) $paths);
 }
開發者ID:MarS2806,項目名稱:Zend-Framework--Doctrine-ORM--PHPUnit--Ant--Jenkins-CI--TDD-,代碼行數:29,代碼來源:Configuration.php

示例4: getDefaultAnnotationReader

 /**
  * Create default annotation reader for extensions
  *
  * @return \Doctrine\Common\Annotations\AnnotationReader
  */
 private function getDefaultAnnotationReader()
 {
     if (null === self::$defaultAnnotationReader) {
         if (version_compare(\Doctrine\Common\Version::VERSION, '2.2.0-DEV', '>=')) {
             $reader = new \Doctrine\Common\Annotations\AnnotationReader();
             \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace('Gedmo\\Mapping\\Annotation', __DIR__ . '/../../');
             $reader = new \Doctrine\Common\Annotations\CachedReader($reader, new ArrayCache());
         } else {
             if (version_compare(\Doctrine\Common\Version::VERSION, '2.1.0RC4-DEV', '>=')) {
                 $reader = new \Doctrine\Common\Annotations\AnnotationReader();
                 \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace('Gedmo\\Mapping\\Annotation', __DIR__ . '/../../');
                 $reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\');
                 $reader = new \Doctrine\Common\Annotations\CachedReader($reader, new ArrayCache());
             } else {
                 if (version_compare(\Doctrine\Common\Version::VERSION, '2.1.0-BETA3-DEV', '>=')) {
                     $reader = new \Doctrine\Common\Annotations\AnnotationReader();
                     $reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\');
                     $reader->setIgnoreNotImportedAnnotations(true);
                     $reader->setAnnotationNamespaceAlias('Gedmo\\Mapping\\Annotation\\', 'gedmo');
                     $reader->setEnableParsePhpImports(false);
                     $reader->setAutoloadAnnotations(true);
                     $reader = new \Doctrine\Common\Annotations\CachedReader(new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache());
                 } else {
                     $reader = new \Doctrine\Common\Annotations\AnnotationReader();
                     $reader->setAutoloadAnnotations(true);
                     $reader->setAnnotationNamespaceAlias('Gedmo\\Mapping\\Annotation\\', 'gedmo');
                     $reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\');
                 }
             }
         }
         self::$defaultAnnotationReader = $reader;
     }
     return self::$defaultAnnotationReader;
 }
開發者ID:pabloasc,項目名稱:test_social,代碼行數:39,代碼來源:MappedEventSubscriber.php

示例5: newDefaultAnnotationDriver

 /**
  * Add a new default annotation driver with a correctly configured annotation reader.
  * 
  * @param array $paths
  * @return Mapping\Driver\AnnotationDriver
  */
 public function newDefaultAnnotationDriver($paths = array())
 {
     if (version_compare(\Doctrine\Common\Version::VERSION, '3.0.0-DEV', '>=')) {
         // Register the ORM Annotations in the AnnotationRegistry
         AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');
         $reader = new AnnotationReader();
         $reader = new \Doctrine\Common\Annotations\CachedReader($reader, new \Doctrine\Common\Cache\ApcCache());
     } else {
         if (version_compare(\Doctrine\Common\Version::VERSION, '2.3.0-DEV', '>=')) {
             // Register the ORM Annotations in the AnnotationRegistry
             // Done manually according to MongoDB ODM but that breaks existing code quickly
             AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');
             $reader = new SimpleAnnotationReader();
             $reader->addNamespace('Doctrine\\OXM\\Mapping');
             $reader = new \Doctrine\Common\Annotations\CachedReader($reader, new \Doctrine\Common\Cache\ApcCache());
         } else {
             if (version_compare(\Doctrine\Common\Version::VERSION, '2.1.0-DEV', '>=')) {
                 // Register the ORM Annotations in the AnnotationRegistry
                 AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');
                 $reader = new AnnotationReader();
                 $reader->setDefaultAnnotationNamespace('Doctrine\\OXM\\Mapping\\');
                 $reader->setIgnoreNotImportedAnnotations(true);
                 $reader->setEnableParsePhpImports(false);
                 $reader = new \Doctrine\Common\Annotations\CachedReader(new \Doctrine\Common\Annotations\IndexedReader($reader), new \Doctrine\Common\Cache\ApcCache());
             } else {
                 $reader = new AnnotationReader();
                 $reader->setDefaultAnnotationNamespace('Doctrine\\OXM\\Mapping\\');
             }
         }
     }
     return new AnnotationDriver($reader, (array) $paths);
 }
開發者ID:illuminadigital,項目名稱:php-xml-marshalling,代碼行數:38,代碼來源:Configuration.php


注:本文中的Doctrine\Common\Annotations\AnnotationReader::setIgnoreNotImportedAnnotations方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。