|
@@ 139-153 (lines=15) @@
|
| 136 |
|
return FALSE; |
| 137 |
|
} |
| 138 |
|
|
| 139 |
|
public function increment($table, $field, $index, Array $condition, $operator, $increment) |
| 140 |
|
{ |
| 141 |
|
$hs = $this->getWriteSocket(); |
| 142 |
|
|
| 143 |
|
list($database, $table) = $this->getTableDatabase($table); |
| 144 |
|
|
| 145 |
|
$idx = $hs->getIndexId($database, $table, $index, [$field]); |
| 146 |
|
$hs->increment($idx, $operator, $condition, [$increment]); |
| 147 |
|
$result = $hs->readResponse(); |
| 148 |
|
|
| 149 |
|
if (!empty($result)) |
| 150 |
|
return (bool)$result[0][0]; |
| 151 |
|
else |
| 152 |
|
return FALSE; |
| 153 |
|
} |
| 154 |
|
|
| 155 |
|
public function decrement($table, $field, $index, Array $condition, $operator, $decrement) |
| 156 |
|
{ |
|
@@ 155-169 (lines=15) @@
|
| 152 |
|
return FALSE; |
| 153 |
|
} |
| 154 |
|
|
| 155 |
|
public function decrement($table, $field, $index, Array $condition, $operator, $decrement) |
| 156 |
|
{ |
| 157 |
|
$hs = $this->getWriteSocket(); |
| 158 |
|
|
| 159 |
|
list($database, $table) = $this->getTableDatabase($table); |
| 160 |
|
|
| 161 |
|
$idx = $hs->getIndexId($database, $table, $index, [$field]); |
| 162 |
|
$hs->decrement($idx, $operator, $condition, [$decrement]); |
| 163 |
|
$result = $hs->readResponse(); |
| 164 |
|
|
| 165 |
|
if (!empty($result)) |
| 166 |
|
return (bool)$result[0][0]; |
| 167 |
|
else |
| 168 |
|
return FALSE; |
| 169 |
|
} |
| 170 |
|
} |