| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
/**
* Creates a new entry in the database.
*
- * @param array $params (reference) an assoc array of name/value pairs
+ * @param array $params
+ * (reference) an assoc array of name/value pairs.
*
- * @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_LineItem object
- * @static
+ * @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_LineItem
*/
public static function create(&$params) {
//create mode only as we don't support editing line items
* price_field_id. This is the inverse function of create. It also
* stores all of the retrieved values in the default array.
*
- * @param array $params (reference ) an assoc array of name/value pairs
- * @param array $defaults (reference ) an assoc array to hold the flattened values
+ * @param array $params
+ * (reference ) an assoc array of name/value pairs.
+ * @param array $defaults
+ * (reference ) an assoc array to hold the flattened values.
*
- * @return CRM_Upgrade_Snapshot_V4p2_Price_BAO_LineItem object
- * @static
+ * @return CRM_Upgrade_Snapshot_V4p2_Price_BAO_LineItem
*/
public static function retrieve(&$params, &$defaults) {
$lineItem = new CRM_Upgrade_Snapshot_V4p2_Price_BAO_LineItem();
* Given a participant id/contribution id,
* return contribution/fee line items
*
- * @param $entityId int participant/contribution id
- * @param $entity string participant/contribution.
+ * @param int $entityId
+ * participant/contribution id.
+ * @param string $entity
+ * participant/contribution.
*
* @param null $isQuick
*
- * @return array of line items
+ * @return array
+ * Array of line items
*/
public static function getLineItems($entityId, $entity = 'participant', $isQuick = NULL) {
$selectClause = $whereClause = $fromClause = NULL;
* This method will create the lineItem array required for
* processAmount method
*
- * @param int $fid price set field id
- * @param array $params reference to form values
- * @param array $fields reference to array of fields belonging
+ * @param int $fid
+ * Price set field id.
+ * @param array $params
+ * Reference to form values.
+ * @param array $fields
+ * Reference to array of fields belonging.
* to the price set used for particular event
- * @param array $values reference to the values array(
- this is
+ * @param array $values
+ * Reference to the values array(.
+ * this is
* lineItem array)
*
* @return void
* @param int $entityTable
*
* @return bool
- * @static
*/
public static function deleteLineItems($entityId, $entityTable) {
$result = FALSE;
* @param array $otherParams
*/
public static function syncLineItems($entityId, $entityTable = 'civicrm_contribution', $amount, $otherParams = NULL) {
- if (!$entityId || CRM_Utils_System::isNull($amount))
+ if (!$entityId || CRM_Utils_System::isNull($amount)) {
return;
+ }
$from = " civicrm_line_item li
LEFT JOIN civicrm_price_field pf ON pf.id = li.price_field_id
$entityName = 'default_contribution_amount';
$where .= " AND ps.name = %4 ";
$params[4] = array($entityName, 'String');
- } elseif ($entityTable == 'civicrm_participant') {
+ }
+ elseif ($entityTable == 'civicrm_participant') {
$from .= "
LEFT JOIN civicrm_price_set_entity cpse ON cpse.price_set_id = ps.id
LEFT JOIN civicrm_price_field_value cpfv ON cpfv.price_field_id = pf.id and cpfv.label = %4 ";
$set .= " ,li.label = %4,
li.price_field_value_id = cpfv.id ";
$where .= " AND cpse.entity_table = 'civicrm_event' AND cpse.entity_id = %5 ";
- $amount = empty($amount) ? 0: $amount;
+ $amount = empty($amount) ? 0 : $amount;
$params += array(
4 => array($otherParams['fee_label'], 'String'),
5 => array($otherParams['event_id'], 'String'),
CRM_Core_DAO::executeQuery($query, $params);
}
+
}