System::getVar()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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