Completed
Pull Request — master (#22)
by Sergey
23:00 queued 08:02
created

EventableModel::deleted()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Isswp101\Persimmon\Test\Models;
4
5
class EventableModel extends ElasticsearchModel
6
{
7
    public static $_index = 'test_events';
8
    public static $_type = 'events';
9
10
    public $name;
11
    public $price = 0;
12
13
    protected function saving()
14
    {
15
        $this->price = 100500;
16
    }
17
18
    protected function saved()
19
    {
20
        $this->price = 1050;
21
    }
22
23
    protected function deleting()
24
    {
25
        if ($this->price !== 100) {
26
            return false;
27
        }
28
29
        return true;
30
    }
31
32
    protected function deleted()
33
    {
34
        $this->price = 1;
35
    }
36
}
37