function postProcess()
 {
     $values = $this->exportValues();
     if (array_key_exists('_qf_Commendation_submit_delete', $values)) {
         // this is our delete condition
         civicrm_api3('Activity', 'delete', array('id' => $this->_aid));
         $this->_action = CRM_Core_Action::DELETE;
     } else {
         // this is our create/update condition
         CRM_Volunteer_BAO_Commendation::create(array('aid' => $this->_aid, 'cid' => $this->_cid, 'details' => $values['details'], 'vid' => $this->_vid));
         $this->_action = $this->_aid ? CRM_Core_Action::UPDATE : CRM_Core_Action::ADD;
     }
     parent::postProcess();
 }
/**
 * Returns array of commendations
 *
 * @param array $params  Associative array of property name/value pairs
 *                       describing the commendations to be retrieved.
 * @example
 * @return array ID-indexed array of matching commendations
 * {@getfields assignment_get}
 * @access public
 */
function civicrm_api3_volunteer_commendation_get($params)
{
    $result = CRM_Volunteer_BAO_Commendation::retrieve($params);
    return civicrm_api3_create_success($result, $params, 'Activity', 'get');
}