<?php
namespace Tionvel\WorkflowBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity()
*/
class WorkflowSequence
{
/**
* @ORM\Id @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string", unique=true)
*/
protected $workflow;
/**
* @ORM\Column(type="bigint")
*/
protected $current = 0;
/**
* @ORM\Column(type="bigint")
*/
protected $step = 1;
public function __construct($workflow, $current, $step)
{
$this->workflow = $workflow;
$this->current = $current;
$this->step = $step;
}
public function increment()
{
$this->current += $this->step;
}
public function getCurrent(): int
{
return $this->current;
}
}