Passed
Push — master ( 6042d7...377078 )
by Mihail
04:38
created

System   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getVar() 0 4 1
1
<?php
2
3
namespace Apps\ActiveRecord;
4
5
6
use Ffcms\Core\Arch\ActiveModel;
7
8
/**
9
 * Class System. Active record model for 'prefix_systems' table
10
 * @package Apps\ActiveRecord
11
 * @property int $id
12
 * @property string $var
13
 * @property string $data
14
 */
15
class System extends ActiveModel
16
{
17
    protected $casts = [
18
        'id' => 'integer',
19
        'var' => 'string',
20
        'data' => 'string'
21
    ];
22
23
    /**
24
     * Get data by variable name
25
     * @param string $name
26
     * @return ActiveModel|null
27
     */
28
    public static function getVar($name)
29
    {
30
        return self::where('var', $name)->first();
31
    }
32
33
}