Completed
Push — master ( 7c2cc0...12c942 )
by Beniamin
02:37
created

DeleteClauseTrait::doAddDelete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
/**
4
 * This file is part of Phuria SQL Builder 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\SQLBuilder\QueryBuilder\Clause;
13
14
/**
15
 * @author Beniamin Jonatan Šimko <[email protected]>
16
 */
17
trait DeleteClauseTrait
18
{
19
    /**
20
     * @var array $deleteClauses
21
     */
22
    private $deleteClauses = [];
23
24
    /**
25
     * @return $this
26
     */
27 1
    public function addDelete()
28
    {
29 1
        foreach (func_get_args() as $clause) {
30 1
            $this->doAddDelete($clause);
31 1
        }
32
33 1
        return $this;
34
    }
35
36
    /**
37
     * @param mixed $clause
38
     */
39 1
    private function doAddDelete($clause)
40
    {
41 1
        $this->deleteClauses[] = $clause;
42 1
    }
43
44
    /**
45
     * @return array
46
     */
47 2
    public function getDeleteClauses()
48
    {
49 2
        return $this->deleteClauses;
50
    }
51
}