|
@@ 90-103 (lines=14) @@
|
| 87 |
|
return FALSE; |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
public function delete($table, $index, Array $condition, $operator) |
| 91 |
|
{ |
| 92 |
|
$hs = $this->getWriteSocket(); |
| 93 |
|
|
| 94 |
|
list($database, $table) = $this->getTableDatabase($table); |
| 95 |
|
|
| 96 |
|
if ($index == HSAL::INDEX_PRIMARY) $index = 'PRIMARY'; |
| 97 |
|
|
| 98 |
|
$index = $hs->openIndex($database, $table, [], ['index' => $index]); |
| 99 |
|
|
| 100 |
|
$result = $index->remove([$operator => $condition]); |
| 101 |
|
|
| 102 |
|
return (bool)$result; |
| 103 |
|
} |
| 104 |
|
|
| 105 |
|
public function insert($table, Array $values) |
| 106 |
|
{ |
|
@@ 135-148 (lines=14) @@
|
| 132 |
|
return (bool)$result; |
| 133 |
|
} |
| 134 |
|
|
| 135 |
|
public function increment($table, $field, $index, Array $condition, $operator, $increment) |
| 136 |
|
{ |
| 137 |
|
$hs = $this->getWriteSocket(); |
| 138 |
|
|
| 139 |
|
list($database, $table) = $this->getTableDatabase($table); |
| 140 |
|
|
| 141 |
|
if ($index == HSAL::INDEX_PRIMARY) $index = 'PRIMARY'; |
| 142 |
|
|
| 143 |
|
$index = $hs->openIndex($database, $table, [$field]); |
| 144 |
|
|
| 145 |
|
$result = $index->update([$operator => $condition], ['+' => $increment]); |
| 146 |
|
|
| 147 |
|
return (bool)$result; |
| 148 |
|
} |
| 149 |
|
|
| 150 |
|
public function decrement($table, $field, $index, Array $condition, $operator, $decrement) |
| 151 |
|
{ |
|
@@ 150-164 (lines=15) @@
|
| 147 |
|
return (bool)$result; |
| 148 |
|
} |
| 149 |
|
|
| 150 |
|
public function decrement($table, $field, $index, Array $condition, $operator, $decrement) |
| 151 |
|
{ |
| 152 |
|
|
| 153 |
|
$hs = $this->getWriteSocket(); |
| 154 |
|
|
| 155 |
|
list($database, $table) = $this->getTableDatabase($table); |
| 156 |
|
|
| 157 |
|
if ($index == HSAL::INDEX_PRIMARY) $index = 'PRIMARY'; |
| 158 |
|
|
| 159 |
|
$index = $hs->openIndex($database, $table, [$field]); |
| 160 |
|
|
| 161 |
|
$result = $index->update([$operator => $condition], ['-' => $decrement]); |
| 162 |
|
|
| 163 |
|
return (bool)$result; |
| 164 |
|
} |
| 165 |
|
|
| 166 |
|
} |