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 $_preCall = array(
32 static $_extCall = array(
33 'singleton' => '::singleton',
40 function &create($className) {
41 $type = CRM_Utils_Array
::value($className, self
::$_classes);
43 return CRM_Core_DAO_Factory
::create($className);
46 $file = self
::$_prefix[$type] . $className;
47 $class = str_replace('/', '_', $file);
49 require_once ($file . self
::$_suffix);
51 $newObj = eval(sprintf("return %s %s%s();",
52 self
::$_preCall[$type],
54 self
::$_extCall[$type]