/** * @return string * @throws NotSupportedException */ public function getDisplayLabel() { $typeDataAndLabels = ActionForWorkflowForm::getTypeDataAndLabels(); if ($this->type == self::TYPE_UPDATE_SELF || $this->type == self::TYPE_SUBSCRIBE_TO_LIST || $this->type == self::TYPE_UNSUBSCRIBE_FROM_LIST) { return $typeDataAndLabels[$this->type]; } elseif ($this->type == self::TYPE_UPDATE_RELATED) { $modelClassName = $this->resolveRealModelClassName($this->relation); return $typeDataAndLabels[$this->type] . ' ' . $modelClassName::getModelLabelByTypeAndLanguage('Plural'); } elseif ($this->type == self::TYPE_CREATE) { $modelClassName = $this->resolveRealModelClassName($this->relation); return $typeDataAndLabels[$this->type] . ' ' . $modelClassName::getModelLabelByTypeAndLanguage('Singular'); } elseif ($this->type == self::TYPE_CREATE_RELATED) { $modelClassName = $this->_modelClassName; $relationModelAdapter = ModelRelationsAndAttributesToWorkflowAdapter::make($modelClassName::getModuleClassName(), $modelClassName, $this->_workflowType); $modelClassName = $relationModelAdapter->getRelationModelClassName($this->relation); $relatedModelClassName = $this->getModelClassNameAndResolveForRelations(); $content = $typeDataAndLabels[$this->type] . ' ' . $modelClassName::getModelLabelByTypeAndLanguage('Plural'); $content .= ' ' . $relatedModelClassName::getModelLabelByTypeAndLanguage('Singular'); return $content; } else { throw new NotSupportedException(); } }
/** * @return array */ protected function resolveTypeDataAndLabels() { return ActionForWorkflowForm::getTypeDataAndLabels(); }
/** * @return array */ protected static function resolveTypeDataAndLabels() { $data = array(); return array_merge($data, ActionForWorkflowForm::getTypeDataAndLabels()); }