private function getExistingSequence() { $sequence = new Sequence('mySequence0815'); $sequence->create(); return $sequence; }
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]; }