/** * Takes a bunch of params that are needed to match certain criteria and * retrieves the relevant objects. Typically the valid params are only * contact_id. We'll tweak this function to be more full featured over a period * of time. This is the inverse function of create. It also stores all the retrieved * values in the default array * * @param array $params (reference ) an assoc array of name/value pairs * @param array $defaults (reference ) an assoc array to hold the flattened values * * @return object CRM_Core_BAO_LocaationType object on success, null otherwise * @access public * @static */ static function retrieve(&$params, &$defaults) { $paymentProcessorType = new CRM_Core_DAO_PaymentProcessorType(); $paymentProcessorType->copyValues($params); if ($paymentProcessorType->find(true)) { CRM_Core_DAO::storeValues($paymentProcessorType, $defaults); return $paymentProcessorType; } return null; }
function setDefaultValues() { $defaults = array(); if (!$this->_id) { $defaults['is_active'] = $defaults['is_default'] = 1; $defaults['user_name_label'] = ts('User Name'); $defaults['password_label'] = ts('Password'); $defaults['signature_label'] = ts('Signature'); $defaults['subject_label'] = ts('Subject'); return $defaults; } $dao = new CRM_Core_DAO_PaymentProcessorType(); $dao->id = $this->_id; if (!$dao->find(TRUE)) { return $defaults; } CRM_Core_DAO::storeValues($dao, $defaults); return $defaults; }
private static function getAllPaymentProcessorTypes($attr) { $ppt = array(); $dao = new CRM_Core_DAO_PaymentProcessorType(); $dao->find(); while ($dao->fetch()) { $ppt[$dao->{$attr}] = $dao->id; } return $ppt; }
private function _getAllPaymentProcessorTypes($attr) { $ppt = array(); require_once "CRM/Core/DAO/PaymentProcessorType.php"; require_once "CRM/Core/DAO.php"; $dao = new CRM_Core_DAO_PaymentProcessorType(); $dao->find(); while ($dao->fetch()) { $ppt[$dao->{$attr}] = $dao->id; } return $ppt; }