Completed
Push — 3.x ( e5eb1c...76cecd )
by Paul
9s
created

Update::ignore()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 *
4
 * This file is part of Aura for PHP.
5
 *
6
 * @license http://opensource.org/licenses/bsd-license.php BSD
7
 *
8
 */
9
namespace Aura\SqlQuery\Mysql;
10
11
use Aura\SqlQuery\Common;
12
13
/**
14
 *
15
 * An object for MySQL UPDATE queries.
16
 *
17
 * @package Aura.SqlQuery
18
 *
19
 */
20
class Update extends Common\Update implements Common\OrderByInterface, Common\LimitInterface
21
{
22
    use Common\LimitTrait;
23
24 4
    protected function build()
25
    {
26 4
        return parent::build()
27 4
            . $this->builder->buildLimit($this->getLimit());
0 ignored issues
show
Bug introduced by
The property builder does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
28
    }
29
30
    /**
31
     *
32
     * Adds or removes LOW_PRIORITY flag.
33
     *
34
     * @param bool $enable Set or unset flag (default true).
35
     *
36
     * @return $this
37
     *
38
     */
39 1
    public function lowPriority($enable = true)
40
    {
41 1
        $this->setFlag('LOW_PRIORITY', $enable);
42 1
        return $this;
43
    }
44
45
    /**
46
     *
47
     * Adds or removes IGNORE flag.
48
     *
49
     * @param bool $enable Set or unset flag (default true).
50
     *
51
     * @return $this
52
     *
53
     */
54 1
    public function ignore($enable = true)
55
    {
56 1
        $this->setFlag('IGNORE', $enable);
57 1
        return $this;
58
    }
59
60
    /**
61
     *
62
     * Adds a column order to the query.
63
     *
64
     * @param array $spec The columns and direction to order by.
65
     *
66
     * @return $this
67
     *
68
     */
69 1
    public function orderBy(array $spec)
70
    {
71 1
        return $this->addOrderBy($spec);
72
    }
73
}
74