src/Messaging/ContactFlow/Context/Context.php line 8

Open in your IDE?
  1. <?php
  2. namespace App\Messaging\ContactFlow\Context;
  3. use App\Entity\Messaging\Subject;
  4. use Symfony\Component\HttpFoundation\Request;
  5. class Context implements \Serializable
  6. {
  7.     protected $currentStepName;
  8.     protected $data;
  9.     protected $request;
  10.     protected $subject;
  11.     protected $hash;
  12.     public function __construct(string $hashstring $currentStepName)
  13.     {
  14.         $this->hash $hash;
  15.         $this->currentStepName $currentStepName;
  16.     }
  17.     public function setCurrentStepName(string $stepName): void
  18.     {
  19.         $this->currentStepName $stepName;
  20.     }
  21.     public function getCurrentStepName(): string
  22.     {
  23.         return $this->currentStepName;
  24.     }
  25.     public function getHash(): string
  26.     {
  27.         return $this->hash;
  28.     }
  29.     public function setRequest(Request $request): void
  30.     {
  31.         $this->request $request;
  32.     }
  33.     public function getRequest(): Request
  34.     {
  35.         return $this->request;
  36.     }
  37.     public function setSubject(Subject $subject): void
  38.     {
  39.         $this->subject $subject;
  40.     }
  41.     public function getSubject(): Subject
  42.     {
  43.         return $this->subject;
  44.     }
  45.     public function setData(?object $data): void
  46.     {
  47.         $this->data $data;
  48.     }
  49.     public function getData(): ?object
  50.     {
  51.         return $this->data;
  52.     }
  53.     public function serialize()
  54.     {
  55.         return serialize([
  56.             $this->currentStepName,
  57.             $this->data,
  58.             $this->hash,
  59.         ]);
  60.     }
  61.     public function unserialize($serialized)
  62.     {
  63.         list($this->currentStepName$this->data$this->hash) = unserialize($serialized);
  64.     }
  65. }