<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
open-dxp / number-sequence-generator-bundle example snippets
public function exampleAction(OpenDxp\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);
}
public function __construct(Generator $generator)
{
$this->generator = $generator;
}
public function generateCode()
{
$code = $this->generator->generateCode("vouchercode", \OpenDxp\Bundle\NumberSequenceGeneratorBundle\RandomGenerator::ALPHANUMERIC, 32);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.