1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* |
4
|
|
|
* This file is part of Aura for PHP. |
5
|
|
|
* |
6
|
|
|
* @license http://opensource.org/licenses/bsd-license.php BSD |
7
|
|
|
* |
8
|
|
|
*/ |
9
|
|
|
namespace Aura\SqlQuery\Sqlite; |
10
|
|
|
|
11
|
|
|
use Aura\SqlQuery\Common; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* |
15
|
|
|
* An object for Sqlite UPDATE queries. |
16
|
|
|
* |
17
|
|
|
* @package Aura.SqlQuery |
18
|
|
|
* |
19
|
|
|
*/ |
20
|
|
|
class Update extends Common\Update implements Common\OrderByInterface, Common\LimitOffsetInterface |
21
|
|
|
{ |
22
|
|
|
use Common\LimitOffsetTrait; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* |
26
|
|
|
* Adds or removes OR ABORT flag. |
27
|
|
|
* |
28
|
|
|
* @param bool $enable Set or unset flag (default true). |
29
|
|
|
* |
30
|
|
|
* @return $this |
31
|
|
|
* |
32
|
|
|
*/ |
33
|
1 |
|
public function orAbort($enable = true) |
34
|
|
|
{ |
35
|
1 |
|
$this->setFlag('OR ABORT', $enable); |
36
|
1 |
|
return $this; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* |
41
|
|
|
* Adds or removes OR FAIL flag. |
42
|
|
|
* |
43
|
|
|
* @param bool $enable Set or unset flag (default true). |
44
|
|
|
* |
45
|
|
|
* @return $this |
46
|
|
|
* |
47
|
|
|
*/ |
48
|
1 |
|
public function orFail($enable = true) |
49
|
|
|
{ |
50
|
1 |
|
$this->setFlag('OR FAIL', $enable); |
51
|
1 |
|
return $this; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* |
56
|
|
|
* Adds or removes OR IGNORE flag. |
57
|
|
|
* |
58
|
|
|
* @param bool $enable Set or unset flag (default true). |
59
|
|
|
* |
60
|
|
|
* @return $this |
61
|
|
|
* |
62
|
|
|
*/ |
63
|
1 |
|
public function orIgnore($enable = true) |
64
|
|
|
{ |
65
|
1 |
|
$this->setFlag('OR IGNORE', $enable); |
66
|
1 |
|
return $this; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* |
71
|
|
|
* Adds or removes OR REPLACE flag. |
72
|
|
|
* |
73
|
|
|
* @param bool $enable Set or unset flag (default true). |
74
|
|
|
* |
75
|
|
|
* @return $this |
76
|
|
|
* |
77
|
|
|
*/ |
78
|
1 |
|
public function orReplace($enable = true) |
79
|
|
|
{ |
80
|
1 |
|
$this->setFlag('OR REPLACE', $enable); |
81
|
1 |
|
return $this; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* |
86
|
|
|
* Adds or removes OR ROLLBACK flag. |
87
|
|
|
* |
88
|
|
|
* @param bool $enable Set or unset flag (default true). |
89
|
|
|
* |
90
|
|
|
* @return $this |
91
|
|
|
* |
92
|
|
|
*/ |
93
|
1 |
|
public function orRollback($enable = true) |
94
|
|
|
{ |
95
|
1 |
|
$this->setFlag('OR ROLLBACK', $enable); |
96
|
1 |
|
return $this; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* |
101
|
|
|
* Adds a column order to the query. |
102
|
|
|
* |
103
|
|
|
* @param array $spec The columns and direction to order by. |
104
|
|
|
* |
105
|
|
|
* @return $this |
106
|
|
|
* |
107
|
|
|
*/ |
108
|
1 |
|
public function orderBy(array $spec) |
109
|
|
|
{ |
110
|
1 |
|
return $this->addOrderBy($spec); |
111
|
|
|
} |
112
|
|
|
} |
113
|
|
|
|