|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* rmarchiv.tk |
|
5
|
|
|
* (c) 2016-2017 by Marcel 'ryg' Hering |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace App\Models; |
|
9
|
|
|
|
|
10
|
|
|
use GeneaLabs\LaravelModelCaching\Traits\Cachable; |
|
11
|
|
|
use Illuminate\Database\Eloquent\Model; |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* Class BoardPost. |
|
15
|
|
|
* |
|
16
|
|
|
* @property int $id |
|
17
|
|
|
* @property int $user_id |
|
18
|
|
|
* @property int $cat_id |
|
19
|
|
|
* @property int $thread_id |
|
20
|
|
|
* @property string $content_md |
|
21
|
|
|
* @property string $content_html |
|
22
|
|
|
* @property \Carbon\Carbon $created_at |
|
23
|
|
|
* @property \Carbon\Carbon $updated_at |
|
24
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\BoardPost whereId($value) |
|
25
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\BoardPost whereUserId($value) |
|
26
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\BoardPost whereCatId($value) |
|
27
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\BoardPost whereThreadId($value) |
|
28
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\BoardPost whereContentMd($value) |
|
29
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\BoardPost whereContentHtml($value) |
|
30
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\BoardPost whereCreatedAt($value) |
|
31
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\BoardPost whereUpdatedAt($value) |
|
32
|
|
|
* @mixin \Eloquent |
|
33
|
|
|
* @property-read \App\Models\BoardCat $cat |
|
34
|
|
|
* @property-read \App\Models\BoardThread $thread |
|
35
|
|
|
* @property-read \App\Models\User $user |
|
36
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Venturecraft\Revisionable\Revision[] $revisionHistory |
|
37
|
|
|
*/ |
|
38
|
|
|
class BoardPost extends Model |
|
39
|
|
|
{ |
|
40
|
|
|
use \Venturecraft\Revisionable\RevisionableTrait; |
|
41
|
|
|
public $timestamps = true; |
|
|
|
|
|
|
42
|
|
|
protected $table = 'board_posts'; |
|
|
|
|
|
|
43
|
|
|
protected $fillable = [ |
|
44
|
|
|
'user_id', |
|
45
|
|
|
'cat_id', |
|
46
|
|
|
'thread_id', |
|
47
|
|
|
'content_md', |
|
48
|
|
|
'content_html', |
|
49
|
|
|
]; |
|
50
|
|
|
|
|
51
|
|
|
protected $guarded = []; |
|
52
|
|
|
|
|
53
|
|
|
public function cat() |
|
54
|
|
|
{ |
|
55
|
|
|
return $this->hasOne('App\Models\BoardCat', 'id', 'cat_id'); |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
public function thread() |
|
59
|
|
|
{ |
|
60
|
|
|
return $this->hasOne('App\Models\BoardThread', 'id', 'thread_id'); |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
public function user() |
|
64
|
|
|
{ |
|
65
|
|
|
return $this->hasOne('App\Models\User', 'id', 'user_id'); |
|
66
|
|
|
} |
|
67
|
|
|
} |
|
68
|
|
|
|
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.