Completed
Push — development ( e80362...5ad269 )
by Claudio
02:41
created

ChocolateyMail::getRelatedAzureIdAttribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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