Commit | Line | Data |
---|---|---|
66c8a610 EM |
1 | <?php |
2 | ||
3 | /** | |
4 | * @method array getContribution() | |
2a402daa TO |
5 | * @method ?int getContributionID() |
6 | * @method $this setContributionID(?int $contributionId) | |
66c8a610 EM |
7 | */ |
8 | trait CRM_Contribute_WorkflowMessage_ContributionTrait { | |
9 | /** | |
10 | * The contribution. | |
11 | * | |
12 | * @var array|null | |
13 | * | |
14 | * @scope tokenContext as contribution | |
15 | */ | |
16 | public $contribution; | |
17 | ||
18 | /** | |
19 | * @var int | |
20 | * @scope tokenContext as contribution_id | |
21 | */ | |
22 | public $contributionId; | |
23 | ||
24 | /** | |
25 | * Set contribution object. | |
26 | * | |
27 | * @param array $contribution | |
28 | * | |
29 | * @return $this | |
30 | */ | |
31 | public function setContribution(array $contribution): self { | |
32 | $this->contribution = $contribution; | |
33 | if (!empty($contribution['id'])) { | |
34 | $this->contributionId = $contribution['id']; | |
35 | } | |
36 | return $this; | |
37 | } | |
38 | ||
39 | } |