/**
  * This will either lazy load a multi injector or find the specific adapter factory on the class and allow
  * the user to override the factory class loader to their app structure.
  *
  * @param $type
  * @return GenericInstanceFactory|MultiInstanceFactory
  */
 public function getAdapterFactory($type)
 {
     $adapterFactory = $this->config->getAdapterFactory();
     if ($adapterFactory instanceof GenericInstanceFactory) {
         return $adapterFactory;
     }
     // if they have used the namespaces option in the config load up the namespace chain
     $namespaces = $this->getConfig()->getNamespaces();
     if (is_array($namespaces) && !empty($namespaces)) {
         $adapterFactory = MultiInstanceFactory::createFromNamespaceList($namespaces, array());
     } else {
         $namespace = Introspection::getNamespaceBase(get_class($this));
         $type = ucwords($type);
         $modelClass = $namespace . "\\Storage\\Adapter\\{$type}";
         $adapterFactory = new MultiInstanceFactory($modelClass);
     }
     return $adapterFactory;
 }