/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
* @package CiviCRM_APIv3
* @subpackage API_Event
*
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* @version $Id: Event.php 30964 2010-11-29 09:41:54Z shot $
*
*/
/**
- * Overrides _civicrm_api3_generic_getlist_params.
+ * @see _civicrm_api3_generic_getlist_params.
*
* @param $request array
*/
function _civicrm_api3_event_getlist_params(&$request) {
- $request['params']['return'] = array('start_date', 'event_type_id', 'title', 'summary');
+ $fieldsToReturn = array('start_date', 'event_type_id', 'title', 'summary');
+ $request['params']['return'] = array_unique(array_merge($fieldsToReturn, $request['extra']));
$request['params']['options']['sort'] = 'start_date DESC';
$request['params'] += array(
'is_template' => 0,
}
/**
- * Overrides _civicrm_api3_generic_getlist_output
+ * @see _civicrm_api3_generic_getlist_output
*
* @param $result array
* @param $request array
if (!empty($row['summary'])) {
$data['description'][] = $row['summary'];
}
+ foreach ($request['extra'] as $field) {
+ $data['extra'][$field] = isset($row[$field]) ? $row[$field] : NULL;
+ }
$output[] = $data;
}
}