Documentation

CRM_Case_WorkflowMessage_CaseActivityTestWorkflow_CaseModelExample extends WorkflowMessageExample
in package

Helper class for defining WorkflowMessage example-data.

By convention, you should name this class relative to the target workflow, as in:

  • Workflow Name: case_activity
  • Workflow Class: CRM_Case_WorkflowMessage_CaseActivity
  • Example Data: CRM_Case_WorkflowMessage_CaseActivity_Foo
  • Example Name: workflow/case_activity/foo

Table of Contents

Properties

$exName  : string
Name for this example specifically.
$wfClass  : string
Name of the workflow for which we are providing example data.
$wfName  : string|null
Name of the workflow for which we are providing example data.

Methods

__construct()  : mixed
WorkflowMessageExample constructor.
build()  : void
Fill-in full details of the example.
extend()  : array<string|int, mixed>
Get an example, merge/extend it with more data, and return the extended variant.
getExampleName()  : string
Get the example name.
getExamples()  : iterable<string|int, mixed>
Get list of examples (summary-info only).
setWorkflowName()  : void
Set the workflow name.
toArray()  : mixed

Properties

$wfClass

Name of the workflow for which we are providing example data.

protected string $wfClass

Ex: 'CRM_Case_WorkflowMessage_CaseActivity'

$wfName

Name of the workflow for which we are providing example data.

protected string|null $wfName

Ex: 'case_activity'

Methods

build()

Fill-in full details of the example.

public build(array<string|int, mixed> &$example) : void
Parameters
$example : array<string|int, mixed>

We start with summary-info for this example (name, title, tags). We may expand upon the example record, filling in dynamic(ish) properties like $example['data'].

Tags
inheritDoc

extend()

Get an example, merge/extend it with more data, and return the extended variant.

public extend(array<string|int, mixed> $base[, array<string|int, mixed> $overrides = [] ]) : array<string|int, mixed>
Parameters
$base : array<string|int, mixed>

Baseline data to build upon.

$overrides : array<string|int, mixed> = []

Additional data to recursively add.

Return values
array<string|int, mixed>

The result of merging the original example with the $overrides.

getExamples()

Get list of examples (summary-info only).

public getExamples() : iterable<string|int, mixed>
Tags
inheritDoc
Return values
iterable<string|int, mixed>

setWorkflowName()

Set the workflow name.

public setWorkflowName(string $workflowName) : void

The workflow name is the value in civicrm_message_template.workflow.

Parameters
$workflowName : string

        
On this page

Search results