EntityManager:entity的工厂类
ClassMetadataFactory:entity的metadata数据工厂类,function有:getAllMetadata getMetadataFor doLoadMetadata
Doctrine\ORM\Mapping\ClassMetadata:entity的metadata类
Doctrine\Persistence\Mapping\Driver\AnnotationDriver:function有getAllClassNames(获取所有的entity类)
缓存类在bootstrap.php配置:
$isDevMode = true;
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/src"), $isDevMode);
默认配置为ArrayCache. 详情看:Setup->createCacheConfiguration 然后Setup->createCacheInstance
Doctrine\ORM\Mapping\Driver\AnnotationDriver:核心驱动,function有:loadMetadataForClass
Doctrine\Common\Annotations\CacheReader:读取类,function有:getPropertyAnnotation
读出来ReflectionProperty然后到Doctrine\Common\Annotations\SimpleAnnotationReader->getPropertyAnnotations再到Doctrine\Common\Annotations\DocParser->parse再到Annotations(),最后是用Doctrine\Common\Annotations\DocLexer类定义的语法树来解析