4 * Class CRM_Contact_DAO_Factory
6 class CRM_Contact_DAO_Factory
{
8 static $_classes = array(
12 'Household' => 'data',
14 'Individual' => 'data',
16 'LocationType' => 'data',
17 'Organization' => 'data',
19 'Relationship' => 'data',
22 static $_prefix = array(
23 'business' => 'CRM/Contact/BAO/',
24 'data' => 'CRM/Contact/DAO/',
27 static $_suffix = '.php';
30 * @param string $className
34 static function &create($className) {
35 $type = CRM_Utils_Array
::value($className, self
::$_classes);
37 return CRM_Core_DAO_Factory
::create($className);
40 $file = self
::$_prefix[$type] . $className;
41 $class = str_replace('/', '_', $file);
43 require_once($file . self
::$_suffix);
45 if ($type == 'singleton') {
46 $newObj = $class::singleton();
49 // this is either 'business' or 'data'