}
}
- /**
- * Get all the tokens supported by this processor.
- *
- * @return array|string[]
- * @throws \API_Exception
- */
- protected function getAllTokens(): array {
- $tokens = parent::getAllTokens();
- if (array_key_exists('CiviCase', CRM_Core_Component::getEnabledComponents())) {
- $tokens['case_id'] = ts('Activity Case ID');
- }
- return $tokens;
- }
-
/**
* Get the basic tokens provided.
*
return $this->basicTokens;
}
+ /**
+ * Get tokens that are special or calculated for this enitty.
+ *
+ * @return array|array[]
+ */
+ protected function getBespokeTokens(): array {
+ $tokens = [];
+ if (array_key_exists('CiviCase', CRM_Core_Component::getEnabledComponents())) {
+ $tokens['case_id'] = ts('Activity Case ID');
+ return [
+ 'case_id' => [
+ 'title' => ts('Activity Case ID'),
+ 'name' => 'case_id',
+ 'type' => 'calculated',
+ 'options' => NULL,
+ 'data_type' => 'Integer',
+ 'audience' => 'user',
+ ],
+ ];
+ }
+ return $tokens;
+ }
+
/**
* @inheritDoc
*/