Exemplo n.º 1
0
 /**
  * Do sharding database by shardId
  * 
  * @param int $shardId
  */
 private function _doShardDb($shardId = 0)
 {
     if (!$this->dbName) {
         throw new Hush_Db_Exception('Please bind db first');
     }
     // if using default shardId
     $shardId = $shardId ? $shardId : $this->_shardId;
     $this->_config->doShardDb($this->dbName, $this->tableName, $shardId);
 }
Exemplo n.º 2
0
Arquivo: Dao.php Projeto: LWFeng/hush
 /**
  * Do sharding database by shardId
  * 
  * @param int $shardId
  */
 private function _doShardDb($shardId = 0)
 {
     if (!$this->dbName) {
         throw new Hush_Db_Exception('Please bind db first');
     }
     // if using default shardId
     $shardId = $shardId ? $shardId : $this->_shardId;
     // running callback function
     $this->_config->doShardDb($this->dbName, $this->tableName, $shardId);
     // set sharded table name for dao
     $this->shardDbName = $this->_config->getDbName();
 }