Documentation

CRM_Contribute_WorkflowMessage_ContributionTrait

Table of Contents

Properties

$contribution  : array<string|int, mixed>|null
The contribution.
$contributionID  : int
$financialTrxn  : array<string|int, mixed>|null
Optional financial transaction (payment).
$financialTrxnID  : int
$isShowLineItems  : bool
Should line items be displayed for the contribution.
$isShowLineSubtotal  : bool
Is it a good idea to show the line item subtotal.
$isShowTax  : bool
Is the site configured such that tax should be displayed.
$lineItems  : array<string|int, mixed>
Line items associated with the contribution.
$taxRateBreakdown  : array<string|int, mixed>
Tax rates paid.
$order  : CRM_Financial_BAO_Order

Methods

getContribution()  : array<string|int, mixed>|null
getContributionID()  : int|null
getFinancialTrxnID()  : int|null
getIsShowLineItems()  : bool
Get bool for whether a line item breakdown be displayed.
getIsShowLineSubtotal()  : bool
Is it a good idea to show the line item subtotal.
getLineItems()  : array<string|int, mixed>
Get the line items.
getTaxRateBreakdown()  : array<string|int, mixed>
Get the line items.
setContribution()  : $this
Set contribution object.
setContributionID()  : $this
setFinancialTrxn()  : $this
Set contribution object.
setFinancialTrxnID()  : $this
setOrder()  : $this
Set order object.
exportExtraTokenContext()  : void
Specify any tokens that should be exported as smarty variables.
exportExtraTplParams()  : void
Extra variables to be exported to smarty based on being calculated.
getOrder()  : CRM_Financial_BAO_Order|null
Get order, if available.

Properties

$contribution

The contribution.

public array<string|int, mixed>|null $contribution
Tags
scope

tokenContext as contribution

$contributionID

public int $contributionID
Tags
scope

tokenContext as contributionId, tplParams as contributionID

$financialTrxn

Optional financial transaction (payment).

public array<string|int, mixed>|null $financialTrxn
Tags
scope

tokenContext as financial_trxn

$financialTrxnID

public int $financialTrxnID
Tags
scope

tokenContext as financial_trxnId

$isShowLineItems

Should line items be displayed for the contribution.

public bool $isShowLineItems

This determination is based on whether the price set is quick config.

Tags
scope

tplParams

$isShowLineSubtotal

Is it a good idea to show the line item subtotal.

public bool $isShowLineSubtotal

This would be true if at least one line has a quantity > 1. Otherwise it is very repetitive.

Tags
scope

tplParams

$isShowTax

Is the site configured such that tax should be displayed.

public bool $isShowTax

$lineItems

Line items associated with the contribution.

public array<string|int, mixed> $lineItems
Tags
scope

tplParams

$taxRateBreakdown

Tax rates paid.

public array<string|int, mixed> $taxRateBreakdown

Generally this would look like

['10.00%' => 100]

To indicate that $100 was changed for 10% tax.

Tags
scope

tplParams

Methods

getContribution()

public getContribution() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

getContributionID()

public getContributionID() : int|null
Return values
int|null

getFinancialTrxnID()

public getFinancialTrxnID() : int|null
Return values
int|null

getIsShowLineItems()

Get bool for whether a line item breakdown be displayed.

public getIsShowLineItems() : bool
Tags
noinspection

PhpUnused

Return values
bool

getIsShowLineSubtotal()

Is it a good idea to show the line item subtotal.

public getIsShowLineSubtotal() : bool

This would be true if at least one line has a quantity > 1. Otherwise it is very repetitive.

Tags
throws
CRM_Core_Exception
Return values
bool

getTaxRateBreakdown()

Get the line items.

public getTaxRateBreakdown() : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
noinspection

PhpUnused

Return values
array<string|int, mixed>

setContribution()

Set contribution object.

public setContribution(array<string|int, mixed> $contribution) : $this
Parameters
$contribution : array<string|int, mixed>
Return values
$this

setContributionID()

public setContributionID([int|null $contributionID = ]) : $this
Parameters
$contributionID : int|null =
Return values
$this

setFinancialTrxn()

Set contribution object.

public setFinancialTrxn(array<string|int, mixed> $financialTrxn) : $this
Parameters
$financialTrxn : array<string|int, mixed>
Return values
$this

setFinancialTrxnID()

public setFinancialTrxnID([int|null $financialTrxnID = ]) : $this
Parameters
$financialTrxnID : int|null =
Return values
$this

setOrder()

Set order object.

public setOrder(CRM_Financial_BAO_Order $order) : $this

Note this is only supported for core use (specifically in example work flow) as the contract might change.

Parameters
$order : CRM_Financial_BAO_Order
Return values
$this

exportExtraTokenContext()

Specify any tokens that should be exported as smarty variables.

protected exportExtraTokenContext(array<string|int, mixed> &$export) : void
Parameters
$export : array<string|int, mixed>

exportExtraTplParams()

Extra variables to be exported to smarty based on being calculated.

protected exportExtraTplParams(array<string|int, mixed> &$export) : void

We export isShowTax to denote whether invoicing is enabled but hopefully at some point we will separate the assumption that invoicing and tax are a package.

Parameters
$export : array<string|int, mixed>
Tags
noinspection

PhpUnused

getOrder()

Get order, if available.

private getOrder() : CRM_Financial_BAO_Order|null

The order is used within the class to calculate line items etc.

Return values
CRM_Financial_BAO_Order|null

        
On this page

Search results