| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* (reference) an assoc array of name/value pairs.
*
* @return CRM_Price_DAO_LineItem
- * @static
*/
public static function create(&$params) {
$id = CRM_Utils_Array::value('id', $params);
}
/**
- * Takes a bunch of params that are needed to match certain criteria and
- * retrieves the relevant objects. Typically, the valid params are only
- * price_field_id. This is the inverse function of create. It also
- * stores all of the retrieved values in the default array.
+ * Retrieve DB object based on input parameters.
+ *
+ * It also stores all the retrieved values in the default array.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
* (reference ) an assoc array to hold the flattened values.
*
* @return CRM_Price_BAO_LineItem
- * @static
*/
public static function retrieve(&$params, &$defaults) {
$lineItem = new CRM_Price_BAO_LineItem();
}
/**
- * Wrapper for line item retrieval when contribution ID is known
+ * Wrapper for line item retrieval when contribution ID is known.
* @param int $contributionID
*
* @return array
* @param int $entityTable
*
* @return bool
- * @static
*/
public static function deleteLineItems($entityId, $entityTable) {
if (!$entityId || !$entityTable) {
* @param bool $update
*
* @return void
- * @static
*/
public static function processPriceSet($entityId, $lineItem, $contributionDetails = NULL, $entityTable = 'civicrm_contribution', $update = FALSE) {
if (!$entityId || !is_array($lineItem)
* Entity Table.
*
* @return void
- * @static
*/
public static function getLineItemArray(&$params, $entityId = NULL, $entityTable = 'contribution', $isRelatedID = FALSE) {
}
/**
- * Calculate tax rate in percentage
+ * Calculate tax rate in percentage.
*
* @param array $lineItemId
* An assoc array of lineItem.
*
- * @return number|void
+ * @return int|void
* tax rate
- *
- * @static
*/
public static function calculateTaxRate($lineItemId) {
if ($lineItemId['unit_price'] == 0) {
- return;
+ return FALSE;
}
if ($lineItemId['html_type'] == 'Text') {
$tax = $lineItemId['tax_amount'] / ($lineItemId['unit_price'] * $lineItemId['qty']) * 100;
}
return $tax;
}
+
}