<?php
namespace App\Messaging\ContactFlow\Context;
use App\Entity\Messaging\Subject;
use Symfony\Component\HttpFoundation\Request;
class Context implements \Serializable
{
protected $currentStepName;
protected $data;
protected $request;
protected $subject;
protected $hash;
public function __construct(string $hash, string $currentStepName)
{
$this->hash = $hash;
$this->currentStepName = $currentStepName;
}
public function setCurrentStepName(string $stepName): void
{
$this->currentStepName = $stepName;
}
public function getCurrentStepName(): string
{
return $this->currentStepName;
}
public function getHash(): string
{
return $this->hash;
}
public function setRequest(Request $request): void
{
$this->request = $request;
}
public function getRequest(): Request
{
return $this->request;
}
public function setSubject(Subject $subject): void
{
$this->subject = $subject;
}
public function getSubject(): Subject
{
return $this->subject;
}
public function setData(?object $data): void
{
$this->data = $data;
}
public function getData(): ?object
{
return $this->data;
}
public function serialize()
{
return serialize([
$this->currentStepName,
$this->data,
$this->hash,
]);
}
public function unserialize($serialized)
{
list($this->currentStepName, $this->data, $this->hash) = unserialize($serialized);
}
}