StatementSummary   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A statement() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of Laravel Sense.
5
 *
6
 * (c) Anton Komarev <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Cog\Laravel\Sense\StatementSummary\Models;
15
16
use Cog\Laravel\Sense\Statement\Models\Statement;
17
use Illuminate\Database\Eloquent\Model;
18
use Illuminate\Database\Eloquent\Relations\BelongsTo;
19
20
class StatementSummary extends Model
21
{
22
    protected $connection = 'sense';
23
24
    protected $table = 'sense_statement_summaries';
25
26
    protected $fillable = [
27
        'request_id',
28
        'connection',
29
        'time_min',
30
        'time_max',
31
        'time_total',
32
    ];
33
34
    protected $casts = [
35
        'queries_count' => 'int',
36
        'time_total' => 'float',
37
        'time_min' => 'float',
38
        'time_max' => 'float',
39
    ];
40
41
    public function statement(): BelongsTo
42
    {
43
        return $this->belongsTo(Statement::class, 'statement_id');
44
    }
45
}
46