/** * returns the list of fields that can be exported * * @access public * return array */ 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['pledge_block'] =& $fields[$name]; } else { self::$_export[$name] =& $fields[$name]; } } } } return self::$_export; }
/** * Return Pledge Block info in Contribution Pages. * * @param int $pageID * Contribution page id. * * @return array */ public static function getPledgeBlock($pageID) { $pledgeBlock = array(); $dao = new CRM_Pledge_DAO_PledgeBlock(); $dao->entity_table = 'civicrm_contribution_page'; $dao->entity_id = $pageID; if ($dao->find(TRUE)) { CRM_Core_DAO::storeValues($dao, $pledgeBlock); } return $pledgeBlock; }
/** * Function to delete the pledgeBlock * * @param int $id pledgeBlock id * * @access public * @static */ static function deletePledgeBlock($id) { CRM_Utils_Hook::pre('delete', 'PledgeBlock', $id, CRM_Core_DAO::$_nullArray); require_once 'CRM/Core/Transaction.php'; $transaction = new CRM_Core_Transaction(); $results = null; $dao = new CRM_Pledge_DAO_PledgeBlock(); $dao->id = $id; $results = $dao->delete(); $transaction->commit(); CRM_Utils_Hook::post('delete', 'PledgeBlock', $dao->id, $dao); return $results; }