Пример #1
0
 protected function seekToStart(Slice $slice)
 {
     $position = $this->fileObject->ftell();
     $seekTo = $this->startPosition + $slice->getStart() - $position;
     if ($seekTo == 0) {
         return;
     }
     $this->fileObject->fseek($seekTo, SEEK_CUR);
 }
Пример #2
0
 protected function checkSlice(Slice $slice)
 {
     if ($slice->getFinish() > $this->getLength() || $slice->getStart() < 0) {
         throw new \OutOfBoundsException(sprintf('the slice %s is outside the length %d of this line.', $slice, $this->getLength()));
     }
 }
Пример #3
0
 /**
  * 得到分表后的表名
  * @param  string $key    
  * @return string
  */
 protected function _tableName($key)
 {
     return Slice::table($this->_sliceTable)->name($this->_table)->key($key)->execute();
 }