ServerTask::fails()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Gameap\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * ServerTask model
9
 * @package Gameap\Models
10
 *
11
 * @property integer $id
12
 * @property string $command
13
 * @property integer $server_id
14
 * @property integer $repeat
15
 * @property integer $repeat_period
16
 * @property integer $counter
17
 * @property string $execute_date
18
 * @property string $payload
19
 * @property string $created_at
20
 * @property string $updated_at
21
 *
22
 * @property Server $server
23
 * @property ServerTaskFail $fails
24
 */
25
class ServerTask extends Model
26
{
27
    public $table = 'servers_tasks';
28
29
    protected $casts = [
30
        'id'            => 'integer',
31
        'server_id'     => 'integer',
32
        'repeat'        => 'integer',
33
        'repeat_period' => 'integer',
34
        'counter'       => 'integer',
35
    ];
36
37
    protected $fillable = [
38
        'command',
39
        'server_id',
40
        'repeat',
41
        'repeat_period',
42
        'execute_date',
43
    ];
44
45
    /**
46
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
47
     */
48
    public function server()
49
    {
50
        return $this->belongsTo(Server::class);
51
    }
52
53
    /**
54
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
55
     */
56
    public function fails()
57
    {
58
        return $this->hasMany(ServerTaskFail::class);
59
    }
60
}
61