Пример #1
0
 /** 
  * Check if there is data to create the object 
  * 
  * @param array  $params         (reference ) an assoc array of name/value pairs 
  * @param array  $ids            the array that holds all the db ids 
  * 
  * @return boolean 
  * @access public 
  * @static 
  */
 function dataExists(&$params, &$ids)
 {
     // if we should not overwrite, then the id is not relevant.
     if (is_array($ids) && CRM_Utils_Array::value('individual', $ids)) {
         return true;
     }
     $fields =& CRM_Contact_DAO_Individual::fields();
     foreach ($fields as $key => $field) {
         if (!empty($params[$key]) && $key != 'contact_id') {
             return true;
         }
     }
     return false;
 }
Пример #2
0
 /**
  * returns the list of fields that can be exported
  *
  * @access public
  * return array
  */
 function &export($prefix = false)
 {
     if (!$GLOBALS['_CRM_CONTACT_DAO_INDIVIDUAL']['_export']) {
         $GLOBALS['_CRM_CONTACT_DAO_INDIVIDUAL']['_export'] = array();
         $fields =& CRM_Contact_DAO_Individual::fields();
         foreach ($fields as $name => $field) {
             if (CRM_Utils_Array::value('export', $field)) {
                 if ($prefix) {
                     $GLOBALS['_CRM_CONTACT_DAO_INDIVIDUAL']['_export']['individual'] =& $fields[$name];
                 } else {
                     $GLOBALS['_CRM_CONTACT_DAO_INDIVIDUAL']['_export'][$name] =& $fields[$name];
                 }
             }
         }
     }
     return $GLOBALS['_CRM_CONTACT_DAO_INDIVIDUAL']['_export'];
 }