Exam Table/Model/Controller
This commit is contained in:
@@ -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',
|
||||
];
|
||||
}
|
||||
@@ -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',
|
||||
];
|
||||
}
|
||||
@@ -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',
|
||||
];
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user