Passed
Pull Request — master (#648)
by John
06:12
created

OJ::problems()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace App\Models\Eloquent;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Support\Facades\DB;
7
8
class OJ extends Model
9
{
10
    protected $table='oj';
11
    protected $primaryKey='oid';
12
13
    public function judge_servers()
14
    {
15
        return $this->hasMany('App\Models\Eloquent\JudgeServer', 'oid', 'oid');
16
    }
17
18
    public function compilers()
19
    {
20
        return $this->hasMany('App\Models\Eloquent\Compiler', 'oid', 'oid');
21
    }
22
23
    public function judgers()
24
    {
25
        return $this->hasMany('App\Models\Eloquent\Judger', 'oid', 'oid');
26
    }
27
28
    public function problems()
29
    {
30
        return $this->hasMany('App\Models\Eloquent\Problem', 'oid', 'OJ');
31
    }
32
}
33