DigiComp.Sequence/README.md

23 lines
781 B
Markdown
Raw Normal View History

2016-06-24 20:57:06 +02:00
DigiComp.Sequence
-------------------------
2020-03-11 12:09:37 +01:00
This is a very simple and stupid tool, helping in generation of gapless sequences. For this task it relies on key
2016-06-24 20:57:06 +02:00
integrity of the database of your choice.
Usage is quite simple also:
2020-03-11 12:00:42 +01:00
/**
* @param \DigiComp\Sequence\Service\SequenceNumberGenerator $sequenceNumberGenerator
*/
2020-03-11 12:09:37 +01:00
public function __construct(SequenceNumberGenerator $sequenceNumberGenerator)
2020-03-11 12:00:42 +01:00
{
2020-03-11 12:09:37 +01:00
$this->orderId = $sequenceNumberGenerator->getNextNumberFor($this);
2020-03-11 12:00:42 +01:00
}
2019-06-07 09:02:40 +02:00
2016-06-24 20:57:06 +02:00
``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.