Exam Table/Model/Controller

This commit is contained in:
Your Name
2021-08-04 14:01:21 +02:00
parent 38efe1af1b
commit 42e06d1005
18 changed files with 278 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
<?php namespace GermanAirlinesVa\Schooling\Models;
use Model;
/**
* Model
*/
class ExamMemberRank extends Model
{
use \October\Rain\Database\Traits\Validation;
/*
* Disable timestamps by default.
* Remove this line if timestamps are defined in the database table.
*/
public $timestamps = false;
/**
* @var string The database table used by the model.
*/
public $table = 'exams';
protected $connection = 'germanairlinesva_schooling';
/**
* @var array Validation rules
*/
public $rules = [
'member_id' => 'required',
'member_rank_id' => 'required',
'start' => 'required',
'status' => 'required',
];
public $belongsTo = [
'member_rank' => 'GermanAirlinesVa\Schooling\Models\MemberRank',
];
}
+37
View File
@@ -0,0 +1,37 @@
<?php namespace GermanAirlinesVa\Schooling\Models;
use Model;
/**
* Model
*/
class ExamTyperating extends Model
{
use \October\Rain\Database\Traits\Validation;
/*
* Disable timestamps by default.
* Remove this line if timestamps are defined in the database table.
*/
public $timestamps = false;
/**
* @var string The database table used by the model.
*/
public $table = 'exams';
protected $connection = 'germanairlinesva_schooling';
/**
* @var array Validation rules
*/
public $rules = [
'member_id' => 'required',
'typerating_id' => 'required',
'start' => 'required',
'status' => 'required',
];
public $belongsTo = [
'typerating' => 'GermanAirlinesVa\Schooling\Models\Typerating',
];
}
+4
View File
@@ -31,6 +31,10 @@ class ExamTyperatingQuestion extends Model
'text' => 'required',
];
public $hasMany = [
'exam_answers' => 'GermanAirlinesVa\Schooling\Models\ExamTyperatingAnswer',
];
public $belongsTo = [
'typerating' => 'GermanAirlinesVa\Schooling\Models\Typerating',
];
+18
View File
@@ -0,0 +1,18 @@
columns:
id:
label: id
type: number
member_id:
label: member_id
type: number
member_rank:
label: member_rank
type: text
relation: member_rank
valueFrom: name
start:
label: start
type: datetime
status:
label: status
type: text
+18
View File
@@ -0,0 +1,18 @@
columns:
id:
label: id
type: number
member_id:
label: member_id
type: number
typerating:
label: typerating
type: text
relation: typerating
valueFrom: name
start:
label: start
type: datetime
status:
label: status
type: text