Exemplo n.º 1
0
 /**
  * @param bool $useWhere
  *
  * @return mixed|void
  */
 public function delete($useWhere = FALSE)
 {
     $this->load_associations();
     $contacts_to_delete = array();
     foreach ($this->participants as $participant) {
         $defaults = array();
         $params = array('id' => $participant->contact_id);
         $temporary_contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults);
         if ($temporary_contact->is_deleted) {
             $contacts_to_delete[$temporary_contact->id] = 1;
         }
         $participant->delete();
     }
     foreach (array_keys($contacts_to_delete) as $contact_id) {
         CRM_Contact_BAO_Contact::deleteContact($contact_id);
     }
     return parent::delete();
 }
Exemplo n.º 2
0
 /**
  * returns the list of fields that can be exported
  *
  * @access public
  * return array
  * @static
  */
 static function &export($prefix = false)
 {
     if (!self::$_export) {
         self::$_export = array();
         $fields = self::fields();
         foreach ($fields as $name => $field) {
             if (CRM_Utils_Array::value('export', $field)) {
                 if ($prefix) {
                     self::$_export['events_in_carts'] =& $fields[$name];
                 } else {
                     self::$_export[$name] =& $fields[$name];
                 }
             }
         }
     }
     return self::$_export;
 }