Number Sequence Generator

reviewed

last reviewed: 17.07.2018

Master Data Management

Author:

Pimcore Core Team

Version

v1.0.3

Last updated

Compatible Pimcore Version

v5.0

Contact

Pimcore Core Team

Issues

https://github.com/pimcore/number-sequence-generator/issues

1  Reviewer

fashxp

reviewed on 17.07.2018

elements

Number Sequence Generator

Master Data Management

Project Summary

Generates continous numbers for example for order numbers or customer numbers.


Readme

Number Sequence Generator Bundle

Continues numbers

Generates continous numbers for example for order numbers or customer numbers.

$generator = \Pimcore::getContainer()->get(\Pimcore\Bundle\NumberSequenceGeneratorBundle\Generator::class);

/*
* Generates the next order number (increments current order number by 1)
* If no order number was generated before it will start with 10000
*/
$next = $generator->getNext('ordernumber', 10000);

/*
* Receive the current order number without incrementing the counter.
*/
$current = $generator->getCurrent('ordernumber');

/*
* Sets the order number to 35017 in the database.
*/
$generator->setCurrent('ordernumber', 35017);

Random numbers (either numeric or alphanumeric)

Generates unique random numbers.

$generator = \Pimcore::getContainer()->get(\Pimcore\Bundle\NumberSequenceGeneratorBundle\RandomGenerator::class);
$code = $generator->generateCode("vouchercode", \Pimcore\Bundle\NumberSequenceGeneratorBundle\RandomGenerator::ALPHANUMERIC, 32);

Review status

reviewed

last reviewed: 17.07.2018

?>

Author:

Pimcore Core Team

Version

v1.0.3

Last updated

Compatible Pimcore Version

v5.0

Contact

Pimcore Core Team

Issues

https://github.com/pimcore/number-sequence-generator/issues

1  Reviewer

fashxp

reviewed on 17.07.2018

elements