Settings::getLifespan()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 0
1
<?php namespace Bedard\Shop\Models;
2
3
use Model;
4
5
/**
6
 * Api Settings Model.
7
 */
8
class Settings extends Model
9
{
10
    /**
11
     * @var array   Behaviors
12
     */
13
    public $implement = ['System.Behaviors.SettingsModel'];
14
15
    /**
16
     * @var string  Settings code
17
     */
18
    public $settingsCode = 'bedard_shop_api_settings_general';
19
20
    /**
21
     * @var string  Settings fields
22
     */
23
    public $settingsFields = 'fields.yaml';
24
25
    public static function getLifespan()
26
    {
27
        $lifespan = self::get('cart_lifespan') ?: 360;
28
29
        return (int) $lifespan;
30
    }
31
}
32