decision = $decision; $this->decisionType = Repo::decision()->getDecisionType($decision->getData('decision')); } /** * @copydoc Variable::descriptions() */ public static function descriptions(): array { return [ self::DECISION => __('emailTemplate.variable.decision.name'), self::DESCRIPTION => __('emailTemplate.variable.decision.description'), self::STAGE => __('emailTemplate.variable.decision.stage'), self::ROUND => __('emailTemplate.variable.decision.round'), ]; } /** * @copydoc Variable::values() */ public function values(string $locale): array { return [ self::DECISION => $this->decisionType->getLabel($locale), self::DESCRIPTION => $this->decisionType->getDescription($locale), self::STAGE => $this->getStageName($locale), self::ROUND => (string) $this->decision->getData('round'), ]; } protected function getStageName(string $locale): string { return __( (string) WorkflowStageDAO::getTranslationKeyFromId($this->decision->getData('stageId')), [], $locale ); } }