Exemple #1
0
 public function testTableName()
 {
     $this->given($tablename = \website\model\Module::tableName())->then->string($tablename)->isEqualTo('MODULE');
 }
 public function getModule($projection = '*')
 {
     return Module::findOneWhere(['id'], [$this->getModuleId()], $projection);
 }
Exemple #3
0
$student->login = '******';
$student->password = $bananaHashed;
$student->role = 'student';
$student->address = 'nowhere';
$student->date_of_birth = '2000-01-01';
$student->phone = '000';
$student->email = '*****@*****.**';
$student->valid = true;
$student->save();
$module1 = new Module();
$module1->name = 'math';
$module1->code = 'math00';
$module1->coefficient = 2;
$module1->valid = true;
$module1->save();
$module2 = new Module();
$module2->name = 'gym';
$module2->code = 'gym00';
$module2->coefficient = 1;
$module2->valid = true;
$module2->save();
$studentSub1 = new StudentModuleSubscription();
$studentSub1->user_id = $student->getId();
$studentSub1->module_id = $module1->getId();
$studentSub1->mark = 18;
$studentSub1->save();
$studentSub2 = new StudentModuleSubscription();
$studentSub2->user_id = $student->getId();
$studentSub2->module_id = $module2->getId();
$studentSub2->mark = 2;
$studentSub2->save();