Completed
Push — master ( 152a7c...c89027 )
by Beniamin
03:17
created

UpdateBuilder::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 2
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;
13
14
use Phuria\SQLBuilder\Table\AbstractTable;
15
16
/**
17
 * @author Beniamin Jonatan Šimko <[email protected]>
18
 */
19
class UpdateBuilder extends AbstractBuilder implements
20
    Clause\LimitClauseInterface,
21
    Clause\OrderByClauseInterface,
22
    Clause\SetClauseInterface,
23
    Clause\WhereClauseInterface,
24
    Component\TableComponentInterface
25
{
26
    use Clause\SetClauseTrait;
27
    use Clause\WhereClauseTrait;
28
    use Clause\OrderByClauseTrait;
29
    use Clause\LimitClauseTrait;
30
    use Component\TableComponentTrait;
31
32
    /**
33
     * @var boolean
34
     */
35
    private $ignore = false;
36
37
    /**
38
     * @return boolean
39
     */
40
    public function isIgnore()
41
    {
42
        return $this->ignore;
43
    }
44
45
    /**
46
     * @param boolean $ignore
47
     */
48
    public function setIgnore($ignore)
49
    {
50
        $this->ignore = $ignore;
51
    }
52
53
    /**
54
     * @param mixed       $table
55
     * @param string|null $alias
56
     *
57
     * @return AbstractTable
58
     */
59
    public function update($table, $alias = null)
60
    {
61
        return $this->addUpdate($table, $alias);
62
    }
63
64
    /**
65
     * @param mixed       $table
66
     * @param string|null $alias
67
     *
68
     * @return AbstractTable
69
     */
70
    public function addUpdate($table, $alias = null)
71
    {
72
        return $this->addRootTable($table, $alias);
73
    }
74
}