Browse Source

Refactored Registry to Locator.

Robert 11 years ago
parent
commit
d65fc3f4e3

+ 2 - 2
src/ORM/Registry/RegistryInterface.php

@@ -14,14 +14,14 @@
  * @license       http://www.opensource.org/licenses/mit-license.php MIT License
  */
 
-namespace Cake\ORM\Registry;
+namespace Cake\ORM\Locator;
 
 use Cake\ORM\Table;
 
 /**
  * Registries for Table objects should implement this interface.
  */
-interface RegistryInterface
+interface LocatorInterface
 {
 
     /**

+ 3 - 3
src/ORM/Registry/DefaultRegistry.php

@@ -14,11 +14,11 @@
  * @license       http://www.opensource.org/licenses/mit-license.php MIT License
  */
 
-namespace Cake\ORM\Registry;
+namespace Cake\ORM\Locator;
 
 use Cake\Core\App;
 use Cake\Datasource\ConnectionManager;
-use Cake\ORM\Registry\RegistryInterface;
+use Cake\ORM\Locator\LocatorInterface;
 use Cake\ORM\Table;
 use Cake\Utility\Inflector;
 use RuntimeException;
@@ -26,7 +26,7 @@ use RuntimeException;
 /**
  * Provides a default registry/factory for Table objects.
  */
-class DefaultRegistry implements RegistryInterface
+class TableLocator implements LocatorInterface
 {
 
     /**

+ 9 - 9
src/ORM/TableRegistry.php

@@ -16,7 +16,7 @@
 
 namespace Cake\ORM;
 
-use Cake\ORM\Registry\RegistryInterface;
+use Cake\ORM\Locator\LocatorInterface;
 
 /**
  * Provides a registry/factory for Table objects.
@@ -56,31 +56,31 @@ class TableRegistry
     /**
      * Singleton for static calls.
      *
-     * @var \Cake\ORM\Registry\RegistryInterface
+     * @var \Cake\ORM\Locator\LocatorInterface
      */
     protected static $_instance;
 
     /**
-     * Default RegistryInterface implementation class.
+     * Default LocatorInterface implementation class.
      *
      * @var string
      */
-    protected static $_defaultRegistryClass = 'Cake\ORM\Registry\DefaultRegistry';
+    protected static $_defaultLocatorClass = 'Cake\ORM\Locator\TableLocator';
 
     /**
-     * Sets and returns singleton instance of Registry.
+     * Sets and returns singleton instance of a LocatorInterface.
      *
-     * @param \Cake\ORM\Registry\RegistryInterface $instance Instance of registry to set.
-     * @return \Cake\ORM\Registry\RegistryInterface
+     * @param \Cake\ORM\Locator\LocatorInterface $instance Instance of registry to set.
+     * @return \Cake\ORM\Locator\LocatorInterface
      */
-    public static function instance(RegistryInterface $instance = null)
+    public static function instance(LocatorInterface $instance = null)
     {
         if ($instance) {
             static::$_instance = $instance;
         }
 
         if (!static::$_instance) {
-            static::$_instance = new static::$_defaultRegistryClass;
+            static::$_instance = new static::$_defaultLocatorClass;
         }
 
         return static::$_instance;