4 * Class CRM_Contact_DAO_Factory
6 class CRM_Contact_DAO_Factory
{
8 public static $_classes = [
12 'Household' => 'data',
14 'Individual' => 'data',
16 'LocationType' => 'data',
17 'Organization' => 'data',
19 'Relationship' => 'data',
22 public static $_prefix = [
23 'business' => 'CRM_Contact_BAO_',
24 'data' => 'CRM_Contact_DAO_',
28 * @param string $className
32 public static function create($className) {
33 $type = CRM_Utils_Array
::value($className, self
::$_classes);
35 return CRM_Core_DAO_Factory
::create($className);
38 $class = self
::$_prefix[$type] . $className;
40 if ($type == 'singleton') {
41 $newObj = $class::singleton();
44 // this is either 'business' or 'data'
45 $newObj = new $class();