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
First, find the task object, from the registry Second, recreate the execution object, Then fill all the data of the new task object from the rest of the row.
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