PaymentCategory::store()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
3
namespace App\Models;
4
5
/**
6
 * Class PaymentCategory.
7
 */
8
class PaymentCategory extends ChocolateyModel
9
{
10
    /**
11
     * Disable Timestamps.
12
     *
13
     * @var bool
14
     */
15
    public $timestamps = false;
16
17
    /**
18
     * The table associated with the model.
19
     *
20
     * @var string
21
     */
22
    protected $table = 'chocolatey_shop_payment_categories';
23
24
    /**
25
     * Primary Key of the Table.
26
     *
27
     * @var string
28
     */
29
    protected $primaryKey = 'id';
30
31
    /**
32
     * Store an Shop Country.
33
     *
34
     * @param string $paymentName
35
     *
36
     * @return PaymentCategory
37
     */
38
    public function store(string $paymentName): PaymentCategory
39
    {
40
        $this->attributes['payment_type'] = $paymentName;
41
        $this->timestamps = false;
42
43
        $this->save();
44
45
        return $this;
46
    }
47
}
48