UserNotification   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 9
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A user() 0 3 1
1
<?php
2
3
namespace Apps\ActiveRecord;
4
5
use Ffcms\Core\Arch\ActiveModel;
6
7
/**
8
 * Class UserNotification. Active record model for user notifications
9
 * @package Apps\ActiveRecord
10
 * @property int $id
11
 * @property int $user_id
12
 * @property string $msg
13
 * @property string $uri
14
 * @property array $vars
15
 * @property bool $readed
16
 * @property string $created_at
17
 * @property string $updated_at
18
 * @property User $user
19
 */
20
class UserNotification extends ActiveModel
21
{
22
    public $casts = [
23
        'id' => 'integer',
24
        'user_id' => 'integer',
25
        'msg' => 'string',
26
        'uri' => 'string',
27
        'vars' => 'serialize',
28
        'readed' => 'boolean'
29
    ];
30
31
    /**
32
     * Get user object as relation
33
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
34
     */
35
    public function user()
36
    {
37
        return $this->belongsTo(User::class);
38
    }
39
}
40