From d78f992eb6ba2c1371156c8a7560e9001024167a Mon Sep 17 00:00:00 2001 From: jepso Date: Sun, 7 Oct 2007 23:03:43 +0000 Subject: [PATCH] fixed locator class name constructing --- lib/Doctrine/Locator.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/Locator.php b/lib/Doctrine/Locator.php index 4f88648c4..ed7714079 100644 --- a/lib/Doctrine/Locator.php +++ b/lib/Doctrine/Locator.php @@ -134,9 +134,15 @@ class Doctrine_Locator implements Countable, IteratorAggregate } else { $className = $name; - if ( ! class_exists($className)) { - $className = $this->_classPrefix . str_replace('.', '_', $name); - + if ( ! class_exists($className)) { + $name = explode('.', $name); + foreach ($name as $k => $value) { + $name[$k] = ucfirst(strtolower($value)); + } + $name = implode('_', $name); + + $className = $this->_classPrefix . $name; + if ( ! class_exists($className)) { throw new Doctrine_Locator_Exception("Couldn't locate resource " . $className); }