Passed
Push — 3.x ( 84b0a1...b6a0a4 )
by Akihito
01:56 queued 13s
created

Insert::orReplace()   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
eloc 2
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
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 1
     */
62
    public function orIgnore($enable = true)
63 1
    {
64 1
        $this->ignore($enable);
65
        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 1
     */
77
    public function ignore($enable = true)
78 1
    {
79 1
        $this->setFlag('OR IGNORE', $enable);
80
        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 1
     */
92
    public function orReplace($enable = true)
93 1
    {
94 1
        $this->setFlag('OR REPLACE', $enable);
95
        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
    public function orRollback($enable = true)
108
    {
109
        $this->setFlag('OR ROLLBACK', $enable);
110
        return $this;
111
    }
112
}
113