Example #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);
 }
Example #2
0
File: Dao.php Project: 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();
 }