src_legacy/Tionvel/WorkflowBundle/Entity/WorkflowSequence.php line 10

Open in your IDE?
  1. <?php
  2. namespace Tionvel\WorkflowBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Entity()
  6. */
  7. class WorkflowSequence
  8. {
  9. /**
  10. * @ORM\Id @ORM\Column(type="integer")
  11. * @ORM\GeneratedValue(strategy="AUTO")
  12. */
  13. protected $id;
  14. /**
  15. * @ORM\Column(type="string", unique=true)
  16. */
  17. protected $workflow;
  18. /**
  19. * @ORM\Column(type="bigint")
  20. */
  21. protected $current = 0;
  22. /**
  23. * @ORM\Column(type="bigint")
  24. */
  25. protected $step = 1;
  26. public function __construct($workflow, $current, $step)
  27. {
  28. $this->workflow = $workflow;
  29. $this->current = $current;
  30. $this->step = $step;
  31. }
  32. public function increment()
  33. {
  34. $this->current += $this->step;
  35. }
  36. public function getCurrent(): int
  37. {
  38. return $this->current;
  39. }
  40. }