Completed
Push — notifications ( d054ca...4f3de2 )
by Tony
02:41
created

NotificationAttrib::user()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Class NotificationAttrib
9
 *
10
 * @package App\Models
11
 * @property int $user_id
12
 * @property string $key
13
 * @property string $value
14
 * @property integer $attrib_id
15
 * @property integer $notifications_id
16
 * @method static \Illuminate\Database\Query\Builder|\App\Models\NotificationAttrib whereAttribId($value)
17
 * @method static \Illuminate\Database\Query\Builder|\App\Models\NotificationAttrib whereNotificationsId($value)
18
 * @method static \Illuminate\Database\Query\Builder|\App\Models\NotificationAttrib whereUserId($value)
19
 * @method static \Illuminate\Database\Query\Builder|\App\Models\NotificationAttrib whereKey($value)
20
 * @method static \Illuminate\Database\Query\Builder|\App\Models\NotificationAttrib whereValue($value)
21
 * @mixin \Eloquent
22
 * @property-read \App\Models\User $user
23
 * @property-read \App\Models\Notification $notification
24
 */
25
class NotificationAttrib extends Model
26
{
27
28
    /**
29
     * Indicates if the model should be timestamped.
30
     *
31
     * @var bool
32
     */
33
    public $timestamps = false;
34
    /**
35
     * The table associated with the model.
36
     *
37
     * @var string
38
     */
39
    protected $table = 'notifications_attribs';
40
    /**
41
     * The primary key column name.
42
     *
43
     * @var string
44
     */
45
    protected $primaryKey = 'attrib_id';
46
47
    // ---- Define Reletionships ----
48
49
    /**
50
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
51
     */
52
    public function user() {
53
        return $this->belongsTo('App\Models\User', 'user_id');
54
    }
55
56
    /**
57
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
58
     */
59
    public function notification() {
60
        return $this->belongsTo('App\Models\Notification', 'notifications_id');
61
    }
62
}
63