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

Delete::orderBy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
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 Delete extends Common\Delete implements Common\OrderByInterface, Common\LimitInterface
21
{
22
    use Common\LimitTrait;
23
24 5
    protected function build()
25
    {
26 5
        return parent::build()
27 5
            . $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 or removes QUICK flag.
63
     *
64
     * @param bool $enable Set or unset flag (default true).
65
     *
66
     * @return $this
67
     *
68
     */
69 1
    public function quick($enable = true)
70
    {
71 1
        $this->setFlag('QUICK', $enable);
72 1
        return $this;
73
    }
74
75
    /**
76
     *
77
     * Adds a column order to the query.
78
     *
79
     * @param array $spec The columns and direction to order by.
80
     *
81
     * @return $this
82
     *
83
     */
84 1
    public function orderBy(array $spec)
85
    {
86 1
        return $this->addOrderBy($spec);
87
    }
88
}
89