Row::beforeSave()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 13
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @namespace
4
 */
5
namespace Application\Push;
6
7
use Bluz\Validator\Traits\Validator;
8
9
/**
10
 * Class Row for `push`
11
 *
12
 * @package  Application\Push
13
 *
14
 * @property integer $id
15
 * @property integer $userId
16
 * @property string $authToken
17
 * @property string $contentEncoding
18
 * @property string $endpoint
19
 * @property string $publicKey
20
 * @property string $created
21
 * @property string $updated
22
 *
23
 * @author   Anton Shevchuk
24
 * @created  2018-11-07 18:33:01
25
 */
26
class Row extends \Bluz\Db\Row
27
{
28
    use Validator;
29
30
    /**
31
     * @return void
32
     */
33
    public function beforeInsert(): void
34
    {
35
    }
36
37
    /**
38
     * @return void
39
     */
40
    public function beforeUpdate(): void
41
    {
42
    }
43
44
    /**
45
     * @return void
46
     */
47
    public function beforeSave(): void
48
    {
49
        $this->addValidator('endpoint')
50
            ->required()
51
            ;
52
        $this->addValidator('authToken')
53
            ->required()
54
            ;
55
        $this->addValidator('publicKey')
56
            ->required()
57
            ;
58
        $this->addValidator('contentEncoding')
59
            ->required()
60
            ;
61
    }
62
}
63