Completed
Pull Request — 3.x (#173)
by
unknown
01:39
created

Insert::ignore()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
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/mit-license.php MIT
7
 *
8
 */
9
namespace Aura\SqlQuery\Sqlite;
10
11
use Aura\SqlQuery\Common;
12
13
/**
14
 *
15
 * An object for Sqlite INSERT queries.
16
 *
17
 * @package Aura.SqlQuery
18
 *
19
 */
20
class Insert extends Common\Insert
21
{
22
    /**
23
     *
24
     * Adds or removes OR ABORT flag.
25
     *
26
     * @param bool $enable Set or unset flag (default true).
27
     *
28
     * @return $this
29
     *
30
     */
31 1
    public function orAbort($enable = true)
32
    {
33 1
        $this->setFlag('OR ABORT', $enable);
34 1
        return $this;
35
    }
36
37
    /**
38
     *
39
     * Adds or removes OR FAIL flag.
40
     *
41
     * @param bool $enable Set or unset flag (default true).
42
     *
43
     * @return $this
44
     *
45
     */
46 1
    public function orFail($enable = true)
47
    {
48 1
        $this->setFlag('OR FAIL', $enable);
49 1
        return $this;
50
    }
51
52
    /**
53
     *
54
     * Adds or removes OR IGNORE flag.
55
     *
56
     * @deprecated use ignore instead
57
     * @param bool $enable Set or unset flag (default true).
58
     *
59
     * @return $this
60
     *
61
     */
62 1
    public function orIgnore($enable = true)
63
    {
64 1
        $this->ignore($enable);
65 1
        return $this;
66
    }
67
68
    /**
69
     *
70
     * Adds or removes OR IGNORE flag.
71
     *
72
     * @param bool $enable Set or unset flag (default true).
73
     *
74
     * @return $this
75
     *
76
     */
77 2
    public function ignore($enable = true)
78
    {
79 2
        $this->setFlag('OR IGNORE', $enable);
80 2
        return $this;
81
    }
82
83
    /**
84
     *
85
     * Adds or removes OR REPLACE flag.
86
     *
87
     * @param bool $enable Set or unset flag (default true).
88
     *
89
     * @return $this
90
     *
91
     */
92 1
    public function orReplace($enable = true)
93
    {
94 1
        $this->setFlag('OR REPLACE', $enable);
95 1
        return $this;
96
    }
97
98
    /**
99
     *
100
     * Adds or removes OR ROLLBACK flag.
101
     *
102
     * @param bool $enable Set or unset flag (default true).
103
     *
104
     * @return $this
105
     *
106
     */
107 1
    public function orRollback($enable = true)
108
    {
109 1
        $this->setFlag('OR ROLLBACK', $enable);
110 1
        return $this;
111
    }
112
}
113