+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
* Class CRM_Utils_Weight
* @param string $weightField
* Field which used to get the wt, default to 'weight'.
*
- * @return integer
+ * @return int
*/
public static function getNewWeight($daoName, $fieldValues = NULL, $weightField = 'weight') {
$selectField = "id AS fieldID, $weightField AS weight";
* Field which contains the weight value,.
* defaults to 'weight'
*
- * @return integer
+ * @return int
*/
public static function getMax($daoName, $fieldValues = NULL, $weightField = 'weight') {
$selectField = "MAX(ROUND($weightField)) AS max_weight";
* Field which contains the weight value,.
* defaults to 'weight'
*
- * @return integer
+ * @return int
*/
public static function getDefaultWeight($daoName, $fieldValues = NULL, $weightField = 'weight') {
$maxWeight = CRM_Utils_Weight::getMax($daoName, $fieldValues, $weightField);
* @return CRM_Core_DAO
* objet that holds the results of the query
*/
- static function &query(
+ public static function &query(
$queryType,
$daoName,
$fieldValues = NULL,
require_once str_replace('_', DIRECTORY_SEPARATOR, $daoName) . ".php";
- $dao = new $daoName;
+ $dao = new $daoName();
$table = $dao->getTablename();
$fields = &$dao->fields();
$fieldlist = array_keys($fields);
'userContext' => $url,
));
}
+
}