pimcore / number-sequence-generator
Pimcore Number Sequence Generator
Installs: 413 564
Dependents: 1
Suggesters: 0
Security: 0
Stars: 11
Watchers: 12
Forks: 4
Open Issues: 0
Type:pimcore-bundle
Requires
- pimcore/pimcore: ^10.6 || ^11.0
Requires (Dev)
- phpstan/phpstan: ^1.9
README
Continues numbers
Generates continous numbers for example for order numbers or customer numbers.
public function exampleAction(Pimcore\Bundle\NumberSequenceGeneratorBundle\Generator $generator) { /* * 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.
public function __construct(Generator $generator) { $this->generator = $generator; } public function generateCode() { $code = $this->generator->generateCode("vouchercode", \Pimcore\Bundle\NumberSequenceGeneratorBundle\RandomGenerator::ALPHANUMERIC, 32); }
Upgrade to Pimcore XI
- Update to latest (allowed) bundle version in Pimcore X and execute all migrations.
- Then update to Pimcore XI.