DigiComp.Sequence/Classes/Command/SequenceCommandController.php

34 lines
741 B
PHP
Raw Normal View History

2014-04-07 15:25:16 +02:00
<?php
namespace DigiComp\Sequence\Command;
2017-03-13 16:59:04 +01:00
use DigiComp\Sequence\Service\SequenceGenerator;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Cli\CommandController;
2014-04-07 15:25:16 +02:00
/**
* A database agnostic SequenceNumber generator
2014-04-07 15:25:16 +02:00
*
* @Flow\Scope("singleton")
*/
class SequenceCommandController extends CommandController
2016-06-24 19:40:43 +02:00
{
/**
2017-03-13 16:59:04 +01:00
* @var SequenceGenerator
2016-06-24 19:40:43 +02:00
* @Flow\Inject
*/
protected $sequenceGenerator;
2014-04-07 15:25:16 +02:00
2016-06-24 19:40:43 +02:00
/**
* Sets minimum number for sequence generator
*
2017-03-13 16:59:04 +01:00
* @param int $to
2016-06-24 19:40:43 +02:00
* @param string $type
*/
public function advanceCommand($to, $type)
{
$this->sequenceGenerator->advanceTo($to, $type);
}
2017-03-13 16:59:04 +01:00
// TODO: make clean up job to delete all but the biggest number to save resources
2014-04-07 15:25:16 +02:00
}