_class() protected static method

Looks up an adapter by class by name.
See also: lithium\core\libraries::locate()
protected static _class ( array $config, array $paths = [] ) : string
$config array Configuration array of class to be found.
$paths array Optional array of search paths that will be checked.
return string Returns a fully-namespaced class reference to the adapter class.
コード例 #1
0
 /**
  * Constructs a data source or adapter object instance from a configuration array.
  *
  * @param array $config
  * @param array $paths
  * @return object
  */
 protected static function _class($config, $paths = array())
 {
     if (!$config['adapter']) {
         $config['adapter'] = $config['type'];
     } else {
         $paths = array_merge(array("adapter.data.source.{$config['type']}"), (array) $paths);
     }
     return parent::_class($config, $paths);
 }