CRM-15905 fix - API: problem sorting contacts on ID
[civicrm-core.git] / api / v3 / Constant.php
index ba3f964bbb1a28bf6814d14429b1534de9660db0..1b7363e4b01e811f91d847472f21ebcf4897f0de 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /*
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  */
 
 /**
+ * Declare deprecated api entity.
+ *
  * @deprecated api notice
- * @return string to indicate this entire api entity is deprecated
+ * @return string
+ *   to indicate this entire api entity is deprecated
  */
 function _civicrm_api3_constant_deprecation() {
   return 'The constant api is deprecated as of CiviCRM 4.4. Please use the getoptions api action instead.';
 }
 
 /**
+ * Get constant values (deprecated).
+ *
  * @deprecated as of CiviCRM 4.4.
  * It's recommended to use the api getoptions action instead
  *
- * @param  string  Name of a public static method of
+ * @param array $params
+ *  Name of a public static method of
  *                  CRM_Core_PseudoConstant: one of
  *  <ul>
  *    <li>activityStatus</li>
@@ -92,9 +97,8 @@ function _civicrm_api3_constant_deprecation() {
  *    <li>worldRegion</li>
  *    <li>wysiwygEditor</li>
  *  </ul>
+ *
  * @return array
- * @example ConstantGet.php
- *  {@getfields constant_get}
  */
 function civicrm_api3_constant_get($params) {
 
@@ -126,7 +130,7 @@ function civicrm_api3_constant_get($params) {
     }
     return civicrm_api3_create_success($values, $params, 'constant');
   }
-  else{
+  else {
     $values = call_user_func(array('CRM_Utils_PseudoConstant', 'getConstant'), $name);
     if (!empty($values)) {
       return civicrm_api3_create_success($values, $params, 'constant');
@@ -136,6 +140,8 @@ function civicrm_api3_constant_get($params) {
 }
 
 /**
+ * Adjust metadata for constant get action.
+ *
  * @param array $params
  */
 function _civicrm_api3_constant_get_spec(&$params) {
@@ -182,12 +188,12 @@ function _civicrm_api3_constant_get_spec(&$params) {
     'worldRegion',
     'wysiwygEditor',
   );
-  $params = (array(
-  'name' => array(
+  $params = array(
+    'name' => array(
       'title' => 'Constant Name',
       'name' => 'name',
       'api.required' => 1,
-        'options' => array_combine($options, $options)
-      ))
+      'options' => array_combine($options, $options),
+    ),
   );
 }