@@ 48-62 (lines=15) @@ | ||
45 | return $this->hsw; |
|
46 | } |
|
47 | ||
48 | public function fetchArray($table, Array $fields, $index, Array $condition, $operator) |
|
49 | { |
|
50 | $hs = $this->getReadSocket(); |
|
51 | ||
52 | list($database, $table) = $this->getTableDatabase($table); |
|
53 | ||
54 | $idx = $hs->getIndexId($database, $table, $index, implode(',',$fields)); |
|
55 | $hs->select($idx, $operator, $condition); |
|
56 | $result = $hs->readResponse(); |
|
57 | ||
58 | if (!empty($result)) |
|
59 | return $result[0]; |
|
60 | else |
|
61 | return FALSE; |
|
62 | } |
|
63 | ||
64 | public function fetchAll($table, Array $fields, $index, Array $condition, $operator, $limit, $offset) |
|
65 | { |
|
@@ 88-102 (lines=15) @@ | ||
85 | return FALSE; |
|
86 | } |
|
87 | ||
88 | public function delete($table, $index, Array $condition, $operator) |
|
89 | { |
|
90 | $hs = $this->getWriteSocket(); |
|
91 | ||
92 | list($database, $table) = $this->getTableDatabase($table); |
|
93 | ||
94 | $idx = $hs->getIndexId($database, $table, $index, ''); |
|
95 | $hs->delete($idx, $operator, $condition); |
|
96 | $result = $hs->readResponse(); |
|
97 | ||
98 | if (!empty($result)) |
|
99 | return (bool)$result[0][0]; |
|
100 | else |
|
101 | return FALSE; |
|
102 | } |
|
103 | ||
104 | public function insert($table, Array $values) |
|
105 | { |