'isEmailPdf' => Civi::settings()->get('invoice_is_email_pdf'),
'isTest' => (bool) ($form->_action & CRM_Core_Action::PREVIEW),
'modelProps' => [
- 'contributionId' => $this->getCurrentRowContributionID(),
- 'contactId' => $form->_receiptContactId,
+ 'contributionID' => $this->getCurrentRowContributionID(),
+ 'contactID' => $form->_receiptContactId,
'membershipID' => $this->getCurrentRowMembershipID(),
],
]
* @var int
* @scope tokenContext as contributionId, tplParams as contributionID
*/
- public $contributionId;
+ public $contributionID;
/**
* Is the site configured such that tax should be displayed.
* @return \CRM_Financial_BAO_Order|null
*/
private function getOrder(): ?CRM_Financial_BAO_Order {
- if (!$this->order && $this->contributionId) {
+ if (!$this->order && $this->contributionID) {
$this->order = new CRM_Financial_BAO_Order();
- $this->order->setTemplateContributionID($this->contributionId);
+ $this->order->setTemplateContributionID($this->contributionID);
}
return $this->order;
}
public function setContribution(array $contribution): self {
$this->contribution = $contribution;
if (!empty($contribution['id'])) {
- $this->contributionId = $contribution['id'];
+ $this->contributionID = $contribution['id'];
}
return $this;
}
'modelProps' => [
'participantID' => $this->_id,
'eventID' => $params['event_id'],
- 'contributionId' => $this->getContributionID(),
+ 'contributionID' => $this->getContributionID(),
],
];
'isTest' => (bool) ($this->_action & CRM_Core_Action::PREVIEW),
'modelProps' => [
'receiptText' => $this->getSubmittedValue('receipt_text'),
- 'contributionId' => $formValues['contribution_id'],
- 'contactId' => $this->_receiptContactId,
+ 'contributionID' => $formValues['contribution_id'],
+ 'contactID' => $this->_receiptContactId,
'membershipID' => $this->getMembershipID(),
],
]
'isEmailPdf' => Civi::settings()->get('invoice_is_email_pdf'),
'modelProps' => [
'receiptText' => $this->getSubmittedValue('receipt_text'),
- 'contactId' => $this->_receiptContactId,
- 'contributionId' => $this->getContributionID(),
+ 'contactID' => $this->_receiptContactId,
+ 'contributionID' => $this->getContributionID(),
'membershipID' => $this->_membershipId,
],
]
/**
* Generic base-class for describing the inputs for a workflow email template.
*
- * @method $this setContactId(int|null $contactId)
- * @method int|null getContactId()
+ * @method $this setContactID(int|null $contactID)
+ * @method int|null getContactID()
* @method $this setContact(array|null $contact)
* @method array|null getContact()
*
* The contact receiving this message.
*
* @var int|null
- * @scope tokenContext, tplParams as contactID
+ * @scope tokenContext as contactId, tplParams as contactID
* @fkEntity Contact
*/
- protected $contactId;
+ protected $contactID;
/**
* @var array|null
* @see ReflectiveWorkflowTrait::validate()
*/
protected function validateExtra_contact(array &$errors) {
- if (empty($this->contactId) && empty($this->contact['id'])) {
+ if (empty($this->contactID) && empty($this->contact['id'])) {
$errors[] = [
'severity' => 'error',
'fields' => ['contactId', 'contact'],
'message' => ts('Message template requires one of these fields (%1)', ['contactId, contact']),
];
}
- if (!empty($this->contactId) && !empty($this->contact)) {
+ if (!empty($this->contactID) && !empty($this->contact)) {
$errors[] = [
'severity' => 'warning',
'fields' => ['contactId', 'contact'],
$msg = WorkflowMessage::create('case_activity', [
'modelProps' => [
- 'contactId' => $contact_id,
+ 'contactID' => $contact_id,
'contact' => ['role' => 'Sand grain counter'],
'isCaseActivity' => 1,
'clientId' => $client_id,
/** @var \Civi\WorkflowMessage\WorkflowMessageInterface $ex */
$ex = static::createExample();
$ex->import('modelProps', [
- 'contactId' => $this->individualCreate(),
+ 'contactID' => $this->individualCreate(),
'myPublicString' => 'ok',
'implicitStringArray' => ['single'],
'myProtectedInt' => 2,
$rand = rand(0, 1000);
$cid = $this->individualCreate(['first_name' => 'Foo', 'last_name' => 'Bar' . $rand, 'prefix_id' => NULL, 'suffix_id' => NULL]);
/** @var \Civi\WorkflowMessage\GenericWorkflowMessage $ex */
- $ex = $this->createExample()->setContactId($cid);
+ $ex = $this->createExample()->setContactID($cid);
\Civi::dispatcher()->addListener('hook_civicrm_alterMailParams', function($e) use (&$hookCount) {
$hookCount++;
$this->assertEquals('my_example_wf', $e->params['workflow'], 'ExampleWorkflow::WORKFLOW should propagate to params[workflow]');