Completed
Push — 1.x ( fd103f...647e2f )
by Daniel
23:51 queued 13:50
created

NoRecordExists::isValid()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 13
rs 9.4285
cc 2
eloc 8
nc 2
nop 1
1
<?php
2
3
namespace ZfcUser\Validator;
4
5
class NoRecordExists extends AbstractRecord
6
{
7
    public function isValid($value)
8
    {
9
        $valid = true;
10
        $this->setValue($value);
11
12
        $result = $this->query($value);
13
        if ($result) {
14
            $valid = false;
15
            $this->error(self::ERROR_RECORD_FOUND);
16
        }
17
18
        return $valid;
19
    }
20
}
21