示例#1
0
 /**
  * Selects all rows with key relative as described
  *
  * @param string  $compare
  * @param array   $keys
  * @param integer $limit
  * @param integer $begin
  *
  * @throws ErrorMessage
  *
  * @return array
  */
 public function select($compare, $keys, $limit = 1, $begin = 0)
 {
     $sk = $this->keys;
     if (is_array($keys)) {
         foreach ($sk as &$value) {
             if (!isset($keys[$value])) {
                 break;
             }
             $value = $keys[$value];
         }
         array_slice($sk, 0, count($keys));
     } else {
         $sk = array($keys);
     }
     $this->io->select($this->indexId, $compare, $sk, $limit, $begin);
     $ret = $this->io->registerCallback(array($this, 'selectCallback'));
     if ($ret instanceof ErrorMessage) {
         throw $ret;
     }
     return $ret;
 }
示例#2
0
 /**
  * Connect to Handler Socket
  *
  * @param string $server
  * @param integer $port
  * @throws \HandlerSocket\IOException
  */
 public function connect($server = 'localhost', $port = 9999)
 {
     parent::connect($server, $port);
 }
示例#3
0
 public function getIndexId($db, $table, $key, $fields)
 {
     return $this->socket->getIndexId($db, $table, $key, $fields);
 }