X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FPseudoConstant.php;h=6753c1a2a6833d0c6d169ddb4199c1681369aa46;hb=2d8a075f719a8310c83d71ff49ac3ae8bdb1ac4e;hp=fc0085ffa61b5e60fd9de4ab40c7ed2c90c6bab9;hpb=f8958d3ce1efe88732ca4fd4b635833c2309242e;p=civicrm-core.git diff --git a/CRM/Contribute/PseudoConstant.php b/CRM/Contribute/PseudoConstant.php index fc0085ffa6..6753c1a2a6 100644 --- a/CRM/Contribute/PseudoConstant.php +++ b/CRM/Contribute/PseudoConstant.php @@ -1,7 +1,7 @@ $value) { - $acceptCreditCard[$value] = $value; - } - return $acceptCreditCard; + return CRM_Core_OptionGroup::values('accept_creditcard', FALSE, FALSE, FALSE, NULL, 'label', TRUE, FALSE, 'name'); } /** @@ -413,5 +413,34 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant { return self::$financialTypeAccount[$financialTypeId]; } + + /** + * Get all batches + * + * @access public + * + * @return array - array reference of all batches if any + * @static + */ + public static function &batch($id = NULL) { + if (!self::$batch) { + $orderBy = " id DESC "; + CRM_Core_PseudoConstant::populate( + self::$batch, + 'CRM_Batch_DAO_Batch', + TRUE, + 'title', + NULL, + NULL, + $orderBy + ); + } + + if ($id) { + $result = CRM_Utils_Array::value($id, self::$batch); + return $result; + } + return self::$batch; + } }