isValid() public static method

public static isValid ( string $c ) : boolean
$c string
return boolean
Beispiel #1
0
 /**
  * @param string $c Type of database factory to create (Mysql, Sqlite,...)
  * @param PDO $dbHandler
  */
 public static function create($c, $dbHandler = null)
 {
     $c = ucfirst(strtolower($c));
     if (!TypeAdapter::isValid($c)) {
         throw new Exception("Database type support for ({$c}) not yet available");
     }
     $method = __NAMESPACE__ . "\\" . "TypeAdapter" . $c;
     return new $method($dbHandler);
 }