diff --git a/module_qa_list.svg b/Assets/module_qa_list.svg similarity index 100% rename from module_qa_list.svg rename to Assets/module_qa_list.svg diff --git a/module_qa_list.xml b/Assets/module_qa_list.xml similarity index 100% rename from module_qa_list.xml rename to Assets/module_qa_list.xml diff --git a/module_qa_question.svg b/Assets/module_qa_question.svg similarity index 100% rename from module_qa_question.svg rename to Assets/module_qa_question.svg diff --git a/module_qa_question.xml b/Assets/module_qa_question.xml similarity index 100% rename from module_qa_question.xml rename to Assets/module_qa_question.xml diff --git a/Models/QAAnswerMapper.php b/Models/QAAnswerMapper.php index 565b05d..ddaa6ab 100644 --- a/Models/QAAnswerMapper.php +++ b/Models/QAAnswerMapper.php @@ -14,6 +14,7 @@ declare(strict_types=1); namespace Modules\QA\Models; +use Modules\Profile\Models\ProfileMapper; use phpOMS\DataStorage\Database\DataMapperAbstract; use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\DataStorage\Database\Query\Column; @@ -69,4 +70,17 @@ class QAAnswerMapper extends DataMapperAbstract * @since 1.0.0 */ protected static $primaryField = 'qa_answer_id'; + + /** + * Belongs to. + * + * @var array> + * @since 1.0.0 + */ + protected static $belongsTo = [ + 'createdBy' => [ + 'mapper' => ProfileMapper::class, + 'dest' => 'qa_answer_created_by', + ], + ]; } diff --git a/Models/QAQuestion.php b/Models/QAQuestion.php index 388fbd9..ac3da41 100644 --- a/Models/QAQuestion.php +++ b/Models/QAQuestion.php @@ -126,7 +126,7 @@ class QAQuestion implements \JsonSerializable $this->category = $category; } - public function getCreatedBy() : int + public function getCreatedBy() { return $this->createdBy; } diff --git a/Models/QAQuestionMapper.php b/Models/QAQuestionMapper.php index e9a7b96..91386d0 100644 --- a/Models/QAQuestionMapper.php +++ b/Models/QAQuestionMapper.php @@ -14,6 +14,7 @@ declare(strict_types=1); namespace Modules\QA\Models; +use Modules\Profile\Models\ProfileMapper; use phpOMS\DataStorage\Database\DataMapperAbstract; use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\DataStorage\Database\Query\Column; @@ -81,6 +82,19 @@ class QAQuestionMapper extends DataMapperAbstract ], ]; + /** + * Belongs to. + * + * @var array> + * @since 1.0.0 + */ + protected static $belongsTo = [ + 'createdBy' => [ + 'mapper' => ProfileMapper::class, + 'dest' => 'qa_question_created_by', + ], + ]; + /** * Primary table. * diff --git a/Theme/Backend/qa-question.tpl.php b/Theme/Backend/qa-question.tpl.php index 2f44ecd..1635e6c 100644 --- a/Theme/Backend/qa-question.tpl.php +++ b/Theme/Backend/qa-question.tpl.php @@ -12,6 +12,9 @@ echo $this->getData('nav')->render();
printHtml($question->getQuestion()); ?>
+
+ <?= $this->getHtml('AccountImage', 0, 0); ?> +