DeleteBuilder::addDelete()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
crap 2
1
<?php
2
3
/**
4
 * This file is part of UnderQuery package.
5
 *
6
 * Copyright (c) 2016 Beniamin Jonatan Šimko
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Phuria\UnderQuery\QueryBuilder;
13
14
/**
15
 * @author Beniamin Jonatan Šimko <[email protected]>
16
 */
17
class DeleteBuilder extends AbstractBuilder implements
18
    Clause\JoinInterface,
19
    Clause\LimitInterface,
20
    Clause\OrderByInterface,
21
    Clause\WhereInterface
22
{
23
    use Clause\JoinTrait;
24
    use Clause\LimitTrait;
25
    use Clause\OrderByTrait;
26
    use Clause\WhereTrait;
27
    use Component\FromComponentTrait;
28
29
    /**
30
     * @var array $deleteClauses
31
     */
32
    private $deleteClauses = [];
33
34
    /**
35
     * @return $this
36
     */
37 1
    public function addDelete()
38
    {
39 1
        foreach (func_get_args() as $clause) {
40 1
            $this->doAddDelete($clause);
41 1
        }
42
43 1
        return $this;
44
    }
45
46
    /**
47
     * @param mixed $clause
48
     */
49 1
    private function doAddDelete($clause)
50
    {
51 1
        $this->deleteClauses[] = $clause;
52 1
    }
53
54
    /**
55
     * @return array
56
     */
57 1
    public function getDeleteClauses()
58
    {
59 1
        return $this->deleteClauses;
60
    }
61
}