Total Complexity | 8 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | class Topic extends Model |
||
24 | { |
||
25 | use SoftDeletes; |
||
26 | |||
27 | protected $fillable = [ |
||
28 | 'contest_id', |
||
29 | 'user_id', |
||
30 | 'problem_id', |
||
31 | 'title', |
||
32 | 'content', |
||
33 | ]; |
||
34 | |||
35 | public function showProblemId() |
||
36 | { |
||
37 | if ($this->problem_id < 100 && $this->contest_id) { |
||
38 | return show_order($this->problem_id); |
||
39 | } |
||
40 | |||
41 | return $this->problem_id; |
||
42 | } |
||
43 | |||
44 | public function title($default = 'untitle') |
||
45 | { |
||
46 | if ($this->title) { |
||
47 | return $this->title; |
||
48 | } |
||
49 | |||
50 | return $default; |
||
51 | } |
||
52 | |||
53 | public function user() |
||
56 | } |
||
57 | |||
58 | public function contest() |
||
61 | } |
||
62 | |||
63 | public function replies() |
||
66 | } |
||
67 | } |
||
68 |