@@ -65,6 +65,10 @@ discard block |
||
65 | 65 | return FALSE; |
66 | 66 | } |
67 | 67 | |
68 | + /** |
|
69 | + * @param integer $limit |
|
70 | + * @param integer $offset |
|
71 | + */ |
|
68 | 72 | public function fetchAll($table, Array $fields, $index, Array $condition, $operator, $limit, $offset) |
69 | 73 | { |
70 | 74 | $hs = $this->getReadSocket(); |
@@ -140,6 +144,9 @@ discard block |
||
140 | 144 | return (bool)$result; |
141 | 145 | } |
142 | 146 | |
147 | + /** |
|
148 | + * @param integer $increment |
|
149 | + */ |
|
143 | 150 | public function increment($table, $field, $index, Array $condition, $operator, $increment) |
144 | 151 | { |
145 | 152 | $hs = $this->getWriteSocket(); |
@@ -155,6 +162,9 @@ discard block |
||
155 | 162 | return (bool)$result; |
156 | 163 | } |
157 | 164 | |
165 | + /** |
|
166 | + * @param integer $decrement |
|
167 | + */ |
|
158 | 168 | public function decrement($table, $field, $index, Array $condition, $operator, $decrement) |
159 | 169 | { |
160 | 170 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | list($database, $table) = $this->getTableDatabase($table); |
49 | 49 | |
50 | - $idx = $hs->getIndexId($database, $table, $index, implode(',',$fields)); |
|
50 | + $idx = $hs->getIndexId($database, $table, $index, implode(',', $fields)); |
|
51 | 51 | $hs->select($idx, $operator, $condition); |
52 | 52 | $result = $hs->readResponse(); |
53 | 53 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | $fields = array_keys($values); |
107 | 107 | |
108 | - $idx = $hs->getIndexId($database, $table, '', implode(',',$fields)); |
|
108 | + $idx = $hs->getIndexId($database, $table, '', implode(',', $fields)); |
|
109 | 109 | $hs->insert($idx, array_values($values)); |
110 | 110 | |
111 | 111 | $result = $hs->readResponse(); |
@@ -1,3 +1,3 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$autoload = require __DIR__.'/../vendor/autoload.php'; |
|
4 | 3 | \ No newline at end of file |
4 | +$autoload = require __DIR__ . '/../vendor/autoload.php'; |
|
5 | 5 | \ No newline at end of file |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | { |
9 | 9 | $hs = new HSAL('localhost', 'hstest', HSAL::DRIVER_HSPHP); |
10 | 10 | |
11 | - $result = $hs->fetchArray('test', ['id','name','cnt'], [HSAL::INDEX_PRIMARY => 3]); |
|
11 | + $result = $hs->fetchArray('test', ['id', 'name', 'cnt'], [HSAL::INDEX_PRIMARY => 3]); |
|
12 | 12 | |
13 | 13 | $this->assertTrue(is_array($result)); |
14 | 14 | $this->assertEquals(3, count($result)); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | { |
22 | 22 | $hs = new HSAL('localhost', 'hstest', HSAL::DRIVER_HSPHP); |
23 | 23 | |
24 | - $result = $hs->fetchAssoc('test', ['id','name','cnt'], [HSAL::INDEX_PRIMARY => 3]); |
|
24 | + $result = $hs->fetchAssoc('test', ['id', 'name', 'cnt'], [HSAL::INDEX_PRIMARY => 3]); |
|
25 | 25 | |
26 | 26 | $this->assertTrue(is_array($result)); |
27 | 27 | $this->assertEquals(3, count($result)); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | { |
9 | 9 | $hs = new HSAL('localhost', 'hstest', HSAL::DRIVER_HANDLERSOCKETI); |
10 | 10 | |
11 | - $result = $hs->fetchArray('test2', ['id','name','cnt'], [HSAL::INDEX_PRIMARY => 3]); |
|
11 | + $result = $hs->fetchArray('test2', ['id', 'name', 'cnt'], [HSAL::INDEX_PRIMARY => 3]); |
|
12 | 12 | |
13 | 13 | $this->assertTrue(is_array($result)); |
14 | 14 | $this->assertEquals(3, count($result)); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | { |
22 | 22 | $hs = new HSAL('localhost', 'hstest', HSAL::DRIVER_HANDLERSOCKETI); |
23 | 23 | |
24 | - $result = $hs->fetchAssoc('test2', ['id','name','cnt'], [HSAL::INDEX_PRIMARY => 3]); |
|
24 | + $result = $hs->fetchAssoc('test2', ['id', 'name', 'cnt'], [HSAL::INDEX_PRIMARY => 3]); |
|
25 | 25 | |
26 | 26 | $this->assertTrue(is_array($result)); |
27 | 27 | $this->assertEquals(3, count($result)); |