TaskSerializer
Handles serialization of `AbstractTask` objects.
This is an internal API, avoid using it in custom implementations.
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Properties
- $container : ContainerInterface
- $taskService : TaskService
Methods
- __construct() : mixed
- deserialize() : AbstractTask
- This method takes care of safely deserializing tasks from the database and either returns a valid Task or throws an InvalidTaskException, which holds information about the broken task.
- extractClassName() : string|null
- If the task class couldn't be figured out from the unserialization (because of uninstalled extensions or exceptions), try to find it in the serialized string with a simple preg match.
Properties
$container read-only
protected
ContainerInterface
$container
$taskService read-only
protected
TaskService
$taskService
Methods
__construct()
public
__construct(ContainerInterface $container, TaskService $taskService) : mixed
Parameters
- $container : ContainerInterface
- $taskService : TaskService
deserialize()
This method takes care of safely deserializing tasks from the database and either returns a valid Task or throws an InvalidTaskException, which holds information about the broken task.
public
deserialize(array<string|int, mixed> $row) : AbstractTask
Parameters
- $row : array<string|int, mixed>
Tags
Return values
AbstractTaskextractClassName()
If the task class couldn't be figured out from the unserialization (because of uninstalled extensions or exceptions), try to find it in the serialized string with a simple preg match.
public
extractClassName(string $serializedTask) : string|null
Parameters
- $serializedTask : string