1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* rmarchiv.tk |
5
|
|
|
* (c) 2016-2017 by Marcel 'ryg' Hering |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
namespace App\Models; |
9
|
|
|
|
10
|
|
|
use Illuminate\Database\Eloquent\Model; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Class UserList. |
14
|
|
|
* |
15
|
|
|
* @property int $id |
16
|
|
|
* @property int $user_id |
17
|
|
|
* @property string $title |
18
|
|
|
* @property string $desc_html |
19
|
|
|
* @property string $desc_md |
20
|
|
|
* @property \Carbon\Carbon $created_at |
21
|
|
|
* @property \Carbon\Carbon $updated_at |
22
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\UserList whereId($value) |
23
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\UserList whereUserId($value) |
24
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\UserList whereTitle($value) |
25
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\UserList whereDescHtml($value) |
26
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\UserList whereDescMd($value) |
27
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\UserList whereCreatedAt($value) |
28
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\UserList whereUpdatedAt($value) |
29
|
|
|
* @mixin \Eloquent |
30
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Venturecraft\Revisionable\Revision[] $revisionHistory |
31
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\UserListItem[] $listitems |
32
|
|
|
* @property-read \App\Models\User $user |
33
|
|
|
*/ |
34
|
|
|
class UserList extends Model |
35
|
|
|
{ |
36
|
|
|
use \Venturecraft\Revisionable\RevisionableTrait; |
37
|
|
|
public $timestamps = true; |
|
|
|
|
38
|
|
|
protected $table = 'user_lists'; |
|
|
|
|
39
|
|
|
protected $fillable = [ |
40
|
|
|
'user_id', |
41
|
|
|
'title', |
42
|
|
|
'desc_html', |
43
|
|
|
'desc_md', |
44
|
|
|
]; |
45
|
|
|
|
46
|
|
|
protected $guarded = []; |
47
|
|
|
|
48
|
|
|
public function listitems() |
49
|
|
|
{ |
50
|
|
|
return $this->hasMany('App\Models\UserListItem', 'list_id', 'id'); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public function user() |
54
|
|
|
{ |
55
|
|
|
return $this->hasOne('App\Models\User', 'id', 'user_id'); |
56
|
|
|
} |
57
|
|
|
} |
58
|
|
|
|
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.