예제 #1
0
 private function getExistingSequence()
 {
     $sequence = new Sequence('mySequence0815');
     $sequence->create();
     return $sequence;
 }
예제 #2
0
파일: Model.php 프로젝트: JoeHorn/piwik
 public function allocateNewArchiveId($numericTable)
 {
     $sequence = new Sequence($numericTable);
     try {
         $idarchive = $sequence->getNextId();
     } catch (Exception $e) {
         // edge case: sequence was not found, create it now
         $sequence->create();
         $idarchive = $sequence->getNextId();
     }
     return $idarchive;
 }
 private function getArchiveId($archiveDate, $archiveId)
 {
     if (!isset($this->archiveIdMap[$archiveDate][$archiveId])) {
         $sequence = new Sequence($this->targetDb->prefixTable('archive_numeric_' . $archiveDate), $this->targetDb->getAdapter(), $this->targetDb->prefixTable(''));
         if (!$sequence->exists()) {
             $sequence->create();
         }
         $this->archiveIdMap[$archiveDate][$archiveId] = $sequence->getNextId();
     }
     return $this->archiveIdMap[$archiveDate][$archiveId];
 }