+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2016 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2016
*/
class CRM_Core_OptionGroup {
static $_values = array();
public static function &values(
$name, $flip = FALSE, $grouping = FALSE,
$localize = FALSE, $condition = NULL,
- $labelColumnName = 'label', $onlyActive = TRUE, $fresh = FALSE, $keyColumnName = 'value'
+ $labelColumnName = 'label', $onlyActive = TRUE, $fresh = FALSE, $keyColumnName = 'value',
+ $orderBy = 'weight'
) {
$cache = CRM_Utils_Cache::singleton();
$cacheKey = self::createCacheKey($name, $flip, $grouping, $localize, $condition, $labelColumnName, $onlyActive, $keyColumnName);
$query .= $condition;
}
- $query .= " ORDER BY v.weight";
+ $query .= " ORDER BY v.{$orderBy}";
$p = array(1 => array($name, 'String'));
$dao = CRM_Core_DAO::executeQuery($query, $p);