Documentation

CRM_Event_WorkflowMessage_ParticipantTrait uses trait:short, trait:short

Trait for participant workflow classes.

Table of Contents

Properties

$contribution  : array<string|int, mixed>|null
The contribution.
$contributionID  : int
$currentParticipant  : array<string|int, mixed>
The current participant (if there are multiple this is the one being emailed).
$eventID  : int
$financialTrxn  : array<string|int, mixed>|null
Optional financial transaction (payment).
$financialTrxnID  : int
$isPrimary  : bool
Is this the primary participant.
$isShowLineItems  : bool
Should line items be displayed for the contribution.
$isShowLineSubtotal  : bool
Is it a good idea to show the line item subtotal.
$isShowParticipantCount  : bool
Should a participant count column be shown.
$isShowTax  : bool
Is the site configured such that tax should be displayed.
$lineItems  : array<string|int, mixed>
Line items associated with the contribution.
$participant  : array<string|int, mixed>|null
The participant record.
$participantCount  : bool
What is the participant count, if 'specifically configured'.
$participantID  : int
$participants  : array<string|int, mixed>
Line items indexed by the participant.
$profilesAdditionalParticipants  : array<string|int, mixed>
$profilesPostForm  : array<string|int, mixed>
$profilesPreForm  : array<string|int, mixed>
$profileTitlesPostForm  : array<string|int, mixed>
$profileTitlesPreForm  : array<string|int, mixed>
$taxRateBreakdown  : array<string|int, mixed>
Tax rates paid.
$note  : string
The note, if any, from the session.
$participantContacts  : array<string|int, mixed>
Details of the participant contacts.
$profiles  : array<string|int, mixed>
The profiles array is not currently assigned / used but might be saner than the ones that are.
$order  : CRM_Financial_BAO_Order

Methods

getContribution()  : array<string|int, mixed>|null
getCurrentParticipant()  : array<string|int, mixed>
Get the line items and tax information indexed by participant.
getEventID()  : int
getIsPrimary()  : bool
Is the participant the primary participant.
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.
getIsShowParticipantCount()  : bool
It is a good idea to show the participant count column.
getLineItems()  : array<string|int, mixed>
Get the line items.
getParticipant()  : array<string|int, mixed>
Get the participant record.
getParticipantCount()  : mixed
Get the count of participants, where count is used in the line items.
getParticipantID()  : int
getParticipants()  : array<string|int, mixed>
Get the line items and tax information indexed by participant.
getPrimaryParticipantID()  : int
getProfiles()  : array<string|int, mixed>
getProfilesAdditionalParticipants()  : array<string|int, mixed>
getProfilesPostForm()  : array<string|int, mixed>
getProfilesPreForm()  : array<string|int, mixed>
getProfileTitlesPostForm()  : array<string|int, mixed>
getProfileTitlesPreForm()  : array<string|int, mixed>
getTaxRateBreakdown()  : array<string|int, mixed>
Get the line items.
setContribution()  : $this
Set contribution object.
setEventID()  : CRM_Event_WorkflowMessage_ParticipantTrait
setFinancialTrxn()  : $this
Set contribution object.
setOrder()  : $this
Set order object.
setParticipant()  : $this
Set participant object.
setParticipantContacts()  : CRM_Event_WorkflowMessage_ParticipantTrait
setParticipantID()  : mixed
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.
getFieldsToLoadForParticipant()  : array<string|int, mixed>
Get the participant fields we need to load.
getOrder()  : CRM_Financial_BAO_Order|null
Get order, if available.
getParticipantContact()  : mixed
getProfilesByPlacement()  : array<string|int, mixed>
isCiviContributeEnabled()  : bool

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

$currentParticipant

The current participant (if there are multiple this is the one being emailed).

public array<string|int, mixed> $currentParticipant

This uses the same format as the participants array.

Tags
scope

tplParams as participant

$eventID

public int $eventID
Tags
scope

tokenContext as eventId, tplParams as eventID

$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

$isPrimary

Is this the primary participant.

public bool $isPrimary
Tags
scope

tplParams as isPrimary

$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

$isShowParticipantCount

Should a participant count column be shown.

public bool $isShowParticipantCount

This would be true if there is a line item on the receipt with more than one participant in it. Otherwise it's confusing to show.

Tags
scope

tplParams as isShowParticipantCount

$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

$participant

The participant record.

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

tokenContext as participant

$participantCount

What is the participant count, if 'specifically configured'.

public bool $participantCount

See getter notes.

Tags
scope

tplParams as participantCount

$participantID

public int $participantID
Tags
scope

tokenContext as participantId, tplParams as participantID

$participants

Line items indexed by the participant.

public array<string|int, mixed> $participants

The format is otherwise the same as lineItems which is also available on the template. The by-participant re-keying permits only including the current participant for non-primary participants and creating a by-participant table for the primary participant.

Tags
scope

tplParams as participants

$profilesAdditionalParticipants

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

tplParams as customProfile

$profilesPostForm

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

tplParams as customPost

$profilesPreForm

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

tplParams as customPre

$profileTitlesPostForm

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

tplParams as customPost_grouptitle

$profileTitlesPreForm

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

tplParams as customPre_grouptitle

$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

$note

The note, if any, from the session.

protected string $note = ''

As multiple notes can be attached to a participant records we only want to render a note as part of the profile if the user entered it in the form submission.

$participantContacts

Details of the participant contacts.

protected array<string|int, mixed> $participantContacts

This would normally be loaded but exists to allow the example to set them.

$profiles

The profiles array is not currently assigned / used but might be saner than the ones that are.

protected array<string|int, mixed> $profiles

Methods

getContribution()

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

getCurrentParticipant()

Get the line items and tax information indexed by participant.

public getCurrentParticipant() : array<string|int, mixed>

We will likely add profile data to this too. This is so we can iterate through participants as the primary participant needs to show them all (and the others need to be able to filter).

Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

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

getIsShowParticipantCount()

It is a good idea to show the participant count column.

public getIsShowParticipantCount() : bool

This would be true if there is a line item on the receipt with more than one participant in it. Otherwise it's confusing to show.

Tags
throws
CRM_Core_Exception
Return values
bool

getParticipant()

Get the participant record.

public getParticipant() : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

getParticipantCount()

Get the count of participants, where count is used in the line items.

public getParticipantCount() : mixed

This might be the case where a line item represents a table of 6 people.

Where the price field value does not record the participant count we ignore.

This lack of specifying it is a bit unclear but seems to be 'presumed 1'. From the templates point of view it is not information to present if not configured.

Tags
throws
CRM_Core_Exception

getParticipants()

Get the line items and tax information indexed by participant.

public getParticipants() : array<string|int, mixed>

We will likely add profile data to this too. This is so we can iterate through participants as the primary participant needs to show them all (and the others need to be able to filter).

Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

getPrimaryParticipantID()

public getPrimaryParticipantID() : int
Return values
int

getProfilesAdditionalParticipants()

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

getProfilesPostForm()

public getProfilesPostForm() : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

getProfilesPreForm()

public getProfilesPreForm() : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

getProfileTitlesPostForm()

public getProfileTitlesPostForm() : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

getProfileTitlesPreForm()

public getProfileTitlesPreForm() : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

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

setFinancialTrxn()

Set contribution object.

public setFinancialTrxn(array<string|int, mixed> $financialTrxn) : $this
Parameters
$financialTrxn : array<string|int, mixed>
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

setParticipant()

Set participant object.

public setParticipant(array<string|int, mixed> $participant) : $this
Parameters
$participant : array<string|int, mixed>
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

getFieldsToLoadForParticipant()

Get the participant fields we need to load.

protected getFieldsToLoadForParticipant() : array<string|int, mixed>
Return values
array<string|int, mixed>

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

getProfilesByPlacement()

private getProfilesByPlacement(string $placement) : array<string|int, mixed>
Parameters
$placement : string

pre or post.

Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

isCiviContributeEnabled()

private isCiviContributeEnabled() : bool
Return values
bool

        
On this page

Search results