public function createInstanceOf($type = '')
{
if (strlen($type) > 0) {
switch (strtolower($type)) {
case 'string':
return '';
case 'array':
return array();
case 'float':
case 'double':
case 'decimal':
return 0.0;
case 'integer':
case 'int':
return 0;
case 'bool':
case 'boolean':
return false;
}
if (class_exists('Prado', false)) {
return Prado::createComponent($type);
} else {
if (class_exists($type, false)) {
//NO auto loading
return new $type();
} else {
throw new TSqlMapException('sqlmap_unable_to_find_class', $type);
}
}
}
}