digicomp / sequence
Sequence is a very simple database agnostic but database based sequence generator
Installs: 2 347
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:neos-package
Requires
- php: >=7.4
- ext-pdo: *
- neos/flow: ^6.3.5 | ^7.0 | ^8.0
Requires (Dev)
- ext-pcntl: *
- phpunit/phpunit: ~8.5
README
This is a very simple tool, helping in generation of gapless sequences. For this task it relies on key integrity of the database of your choice.
Usage is quite simple also:
/** * @param SequenceGenerator $sequenceGenerator */ public function __construct(SequenceGenerator $sequenceNumberGenerator) { $this->orderId = $sequenceGenerator->getNextNumberFor($this); }
getNextNumberFor
allows you to give an object (which will be resolved to its FQCN) or a custom sequence name.
The SequenceCommandController
helps you to set the last sequence number, in case of migrations or similar. See
./flow help sequence:setlastnumberfor
if interested.