From 627124583150dfeeb3e1e01ee5a5b3020cf0304d Mon Sep 17 00:00:00 2001 From: beberlei Date: Thu, 11 Feb 2010 22:47:59 +0000 Subject: [PATCH] [2.0] DDC-318 - Fix successive calls to AnnotationDriver::getAllClassNames() --- lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index d8d14b546..b10be89f4 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -62,6 +62,11 @@ class AnnotationDriver implements Driver * @var string */ protected $_fileExtension = '.php'; + + /** + * @param array + */ + protected $_classNames = null; /** * Initializes a new AnnotationDriver that uses the given AnnotationReader for reading @@ -407,6 +412,10 @@ class AnnotationDriver implements Driver */ public function getAllClassNames() { + if ($this->_classNames !== null) { + return $this->_classNames; + } + $classes = array(); if ($this->_paths) { @@ -439,6 +448,8 @@ class AnnotationDriver implements Driver } } } + + $this->_classNames = $classes; return $classes; }