digicomp/sequence

Last activity 10 Mar 2020 1 2335
composer require digicomp/sequence

Sequence is a very simple database agnostic but database based sequence generator

2.1.2

Homepage
https://github.com/digicomp/DigiComp.Sequence
Version
2.1.2
Type
neos-package
Release Date
Mar 10, 2020 13:53
Source
git
Distribution
zip
Requires
Requires (dev)
MIT
  • #flow
  • #doctrine
  • #sequence
  • #neos
2e10a9450fb4466ba19021b08d336c5c33ba1343

DigiComp.Sequence

This is a very simple and stupid 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 \DigiComp\Sequence\Service\SequenceNumberGenerator $sequenceNumberGenerator
 */
public function __construct(SequenceNumberGenerator $sequenceNumberGenerator) 
{
	$this->orderId = $sequenceNumberGenerator->getNextNumberFor($this);		
}

getNextNumberFor allows you to give an object which will be resolved to its FQCN or a custom sequence name.

The CommandController helps you to advance the current sequence number, in case of migrations or similar.

See ./flow help sequence:advance if interested.

The content of the readme is provided by Github
The same vendor provides 6 package(s).