mode changes

This commit is contained in:
Dennis Eichhorn 2021-02-20 10:59:06 +01:00
parent cc89352e1d
commit 7e7243b95c
15 changed files with 18 additions and 4 deletions

0
.gitignore vendored Normal file → Executable file
View File

View File

@ -82,6 +82,11 @@
"type": "TEXT",
"null": false
},
"qa_question_question_raw": {
"name": "qa_question_question_raw",
"type": "TEXT",
"null": false
},
"qa_question_created_at": {
"name": "qa_question_created_at",
"type": "DATETIME",
@ -156,6 +161,11 @@
"type": "TEXT",
"null": false
},
"qa_answer_answer_raw": {
"name": "qa_answer_answer_raw",
"type": "TEXT",
"null": false
},
"qa_answer_created_at": {
"name": "qa_answer_created_at",
"type": "DATETIME",

View File

@ -91,7 +91,8 @@ final class ApiController extends Controller
$question = new QAQuestion();
$question->name = (string) $request->getData('title');
$question->question = (string) $request->getData('plain');
$question->questionRaw = (string) $request->getData('plain');
$question->question = Markdown::parse((string) ($request->getData('plain') ?? ''));
$question->setLanguage((string) $request->getData('language'));
$question->setCategory(new NullQACategory((int) $request->getData('category')));
$question->setStatus((int) $request->getData('status'));
@ -185,7 +186,8 @@ final class ApiController extends Controller
$mardkownParser = new Markdown();
$answer = new QAAnswer();
$answer->answer = (string) $request->getData('plain');
$answer->answerRaw = (string) $request->getData('plain');
$answer->answer = Markdown::parse((string) ($request->getData('plain') ?? ''));
$answer->question = new NullQAQuestion((int) $request->getData('question'));
$answer->setStatus((int) $request->getData('status'));
$answer->createdBy = new NullAccount($request->header->account);

0
Docs/Dev/en/SUMMARY.md Normal file
View File

0
Docs/Dev/en/structure.md Normal file
View File

View File

@ -43,7 +43,7 @@ class QAAnswer implements \JsonSerializable
* @var string
* @since 1.0.0
*/
public $answer = '';
public string $answer = '';
/**
* Answer raw.
@ -51,7 +51,7 @@ class QAAnswer implements \JsonSerializable
* @var string
* @since 1.0.0
*/
public $answerRaw = '';
public string $answerRaw = '';
/**
* Question

View File

@ -35,6 +35,7 @@ final class QAAnswerMapper extends DataMapperAbstract
*/
protected static array $columns = [
'qa_answer_id' => ['name' => 'qa_answer_id', 'type' => 'int', 'internal' => 'id'],
'qa_answer_answer_raw' => ['name' => 'qa_answer_answer_raw', 'type' => 'string', 'internal' => 'answerRaw'],
'qa_answer_answer' => ['name' => 'qa_answer_answer', 'type' => 'string', 'internal' => 'answer'],
'qa_answer_question' => ['name' => 'qa_answer_question', 'type' => 'int', 'internal' => 'question'],
'qa_answer_status' => ['name' => 'qa_answer_status', 'type' => 'int', 'internal' => 'status'],

0
Models/QACategoryL11n.php Normal file → Executable file
View File

0
Models/QACategoryL11nMapper.php Normal file → Executable file
View File

View File

@ -39,6 +39,7 @@ final class QAQuestionMapper extends DataMapperAbstract
'qa_question_title' => ['name' => 'qa_question_title', 'type' => 'string', 'internal' => 'name'],
'qa_question_language' => ['name' => 'qa_question_language', 'type' => 'string', 'internal' => 'language'],
'qa_question_question' => ['name' => 'qa_question_question', 'type' => 'string', 'internal' => 'question'],
'qa_question_question_raw' => ['name' => 'qa_question_question_raw', 'type' => 'string', 'internal' => 'questionRaw'],
'qa_question_status' => ['name' => 'qa_question_status', 'type' => 'int', 'internal' => 'status'],
'qa_question_category' => ['name' => 'qa_question_category', 'type' => 'int', 'internal' => 'category'],
'qa_question_created_by' => ['name' => 'qa_question_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],

0
Theme/Backend/Lang/de.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/en.lang.php Normal file → Executable file
View File

0
tests/Autoloader.php Normal file → Executable file
View File

0
tests/Bootstrap.php Normal file → Executable file
View File

0
tests/phpunit_default.xml Normal file → Executable file
View File