3 class CRM_Contact_DAO_Factory
{
5 static $_classes = array(
11 'Individual' => 'data',
13 'LocationType' => 'data',
14 'Organization' => 'data',
16 'Relationship' => 'data',
19 static $_prefix = array(
20 'business' => 'CRM/Contact/BAO/',
21 'data' => 'CRM/Contact/DAO/',
24 static $_suffix = '.php';
26 static function &create($className) {
27 $type = CRM_Utils_Array
::value($className, self
::$_classes);
29 return CRM_Core_DAO_Factory
::create($className);
32 $file = self
::$_prefix[$type] . $className;
33 $class = str_replace('/', '_', $file);
35 require_once ($file . self
::$_suffix);
37 if ($type == 'singleton') {
38 $newObj = $class::singleton();
41 // this is either 'business' or 'data'