mirror of
https://github.com/Karaka-Management/oms-QA.git
synced 2026-02-08 20:28:41 +00:00
Re-format mappers
This commit is contained in:
parent
ca746facb0
commit
27a6b7db0c
|
|
@ -37,11 +37,11 @@ class QAAnswerMapper extends DataMapperAbstract
|
|||
* @since 1.0.0
|
||||
*/
|
||||
protected static $columns = [
|
||||
'qa_answer_id' => ['name' => 'qa_answer_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'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'],
|
||||
'qa_answer_accepted' => ['name' => 'qa_answer_accepted', 'type' => 'bool', 'internal' => 'isAccepted'],
|
||||
'qa_answer_id' => ['name' => 'qa_answer_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'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'],
|
||||
'qa_answer_accepted' => ['name' => 'qa_answer_accepted', 'type' => 'bool', 'internal' => 'isAccepted'],
|
||||
'qa_answer_created_by' => ['name' => 'qa_answer_created_by', 'type' => 'int', 'internal' => 'createdBy'],
|
||||
'qa_answer_created_at' => ['name' => 'qa_answer_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ class QABadgeMapper extends DataMapperAbstract
|
|||
* @since 1.0.0
|
||||
*/
|
||||
protected static $columns = [
|
||||
'qa_badge_id' => ['name' => 'qa_badge_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'qa_badge_name' => ['name' => 'qa_badge_name', 'type' => 'string', 'internal' => 'name'],
|
||||
'qa_badge_id' => ['name' => 'qa_badge_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'qa_badge_name' => ['name' => 'qa_badge_name', 'type' => 'string', 'internal' => 'name'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,9 +37,9 @@ class QACategoryMapper extends DataMapperAbstract
|
|||
* @since 1.0.0
|
||||
*/
|
||||
protected static $columns = [
|
||||
'qa_category_id' => ['name' => 'qa_category_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'qa_category_id' => ['name' => 'qa_category_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'qa_category_name' => ['name' => 'qa_category_name', 'type' => 'string', 'internal' => 'name'],
|
||||
'qa_category_parent' => ['name' => 'qa_category_parent', 'type' => 'int', 'internal' => 'parent'],
|
||||
'qa_category_parent' => ['name' => 'qa_category_parent', 'type' => 'int', 'internal' => 'parent'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,12 +37,12 @@ class QAQuestionMapper extends DataMapperAbstract
|
|||
* @since 1.0.0
|
||||
*/
|
||||
protected static $columns = [
|
||||
'qa_question_id' => ['name' => 'qa_question_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'qa_question_title' => ['name' => 'qa_question_title', 'type' => 'string', 'internal' => 'name'],
|
||||
'qa_question_id' => ['name' => 'qa_question_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'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_status' => ['name' => 'qa_question_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'qa_question_category' => ['name' => 'qa_question_category', 'type' => 'int', 'internal' => 'category'],
|
||||
'qa_question_question' => ['name' => 'qa_question_question', 'type' => 'string', 'internal' => 'question'],
|
||||
'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'],
|
||||
'qa_question_created_at' => ['name' => 'qa_question_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
||||
];
|
||||
|
|
@ -54,17 +54,17 @@ class QAQuestionMapper extends DataMapperAbstract
|
|||
* @since 1.0.0
|
||||
*/
|
||||
protected static $hasMany = [
|
||||
'badges' => [
|
||||
'mapper' => QABadgeMapper::class,
|
||||
'table' => 'qa_question_badge',
|
||||
'src' => 'qa_question_badge_badge',
|
||||
'dst' => 'qa_question_badge_question',
|
||||
'badges' => [
|
||||
'mapper' => QABadgeMapper::class,
|
||||
'table' => 'qa_question_badge',
|
||||
'src' => 'qa_question_badge_badge',
|
||||
'dst' => 'qa_question_badge_question',
|
||||
],
|
||||
'answers' => [
|
||||
'mapper' => QAAnswerMapper::class,
|
||||
'table' => 'qa_answer',
|
||||
'dst' => 'qa_answer_question',
|
||||
'src' => null,
|
||||
'mapper' => QAAnswerMapper::class,
|
||||
'table' => 'qa_answer',
|
||||
'dst' => 'qa_answer_question',
|
||||
'src' => null,
|
||||
],
|
||||
];
|
||||
|
||||
|
|
@ -76,8 +76,8 @@ class QAQuestionMapper extends DataMapperAbstract
|
|||
*/
|
||||
protected static $ownsOne = [
|
||||
'category' => [
|
||||
'mapper' => QACategoryMapper::class,
|
||||
'dst' => 'qa_question_category',
|
||||
'mapper' => QACategoryMapper::class,
|
||||
'dst' => 'qa_question_category',
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user