JobRecord
API reference › Debug Core › Panel › Queue › JobRecord
Typed view-model for a single queue lifecycle event captured during the request (push, exec, or error).
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$attempt readonly constructor | int| | Current attempt number for exec / error events (1 for the first run). null for push events. | JobRecord |
$componentId readonly constructor | string | Identifier of the queue component that emitted the event ('queue', 'queueEmail', …). '' when the sender could not be matched against any registered component. | JobRecord |
$delay readonly constructor | int| | Delay before execution declared at push time, in seconds. null when the driver default applies. | JobRecord |
$driverClass readonly constructor | string | Fully qualified class name of the queue driver that emitted the event. '' when the sender was not an object (defensive default). | JobRecord |
$driverName readonly constructor | string | Friendly display name of the queue driver detected from the event sender’s class name ('Sync', 'Database', 'Redis', 'AMQP', 'Beanstalk', 'Gearman', or a custom-detected fallback). | JobRecord |
$duration readonly constructor | float| | Execution time in seconds for exec / error events. null for push events. | JobRecord |
$error readonly constructor | string | Captured exception message for error events. '' for push / exec events. | JobRecord |
$eventType readonly constructor | string | Lifecycle phase: 'push' (job enqueued), 'exec' (job finished successfully) or 'error' (job threw). | JobRecord |
$isAsync readonly constructor | bool | false when the driver runs jobs in-process during the same request (sync), true when jobs run in a separate worker (db, redis, amqp, beanstalk, gearman). The detail view uses this flag to show a hint about exec events living in CLI debug snapshots. | JobRecord |
$jobClass readonly constructor | string | Fully qualified class name of the job. '' when the event carried no job (defensive default). | JobRecord |
$jobId readonly constructor | string | Driver-specific message id (the queue’s internal handle), or '' when the driver did not expose one. | JobRecord |
$payloadFields readonly constructor | array<string, | Recursively normalised public-property tree of the job payload, captured at push time. | JobRecord |
$priority readonly constructor | int| | Priority override declared at push time. null when the driver default applies. | JobRecord |
$time readonly constructor | float | Capture timestamp in seconds since the Unix epoch (microseconds preserved as the fractional part). | JobRecord |
$ttr readonly constructor | int| | Time-to-run override declared at push time, in seconds. null when the driver default applies. | JobRecord |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a queue lifecycle event record. | JobRecord |
fromArray() static | Narrows one persisted event of the queue payload into a typed record. | JobRecord |
fromCapture() static | Narrows one captured queue-event payload into a typed record. | JobRecord |
jsonSerialize() | Returns the typed row for JSON serialization. | JobRecord |
Constants
Section titled “Constants”| Constant | Value | Description | Defined by |
|---|---|---|---|
EVENT_TYPES | [self::TYPE_PUSH, | JobRecord | |
EVENT_VARIANTS | [self::TYPE_PUSH => ['variant' => 'queued', | JobRecord | |
TYPE_ERROR | 'error' | Lifecycle phase value used when the job threw. | JobRecord |
TYPE_EXEC | 'exec' | Lifecycle phase value used when the job finished successfully. | JobRecord |
TYPE_PUSH | 'push' | Lifecycle phase value used when the job was enqueued. | JobRecord |
Property details
Section titled “Property details”$payloadFields
Section titled “$payloadFields ”public readonly array<string, mixed> $payloadFieldsRecursively normalised public-property tree of the job payload, captured at push time.
Scalars (string/int/float/bool/null) round-trip as-is; nested objects expand into nested arrays
with a synthetic __class key carrying their FQCN. Empty when the event carried no job.
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(string $eventType, string $componentId, string $driverName, string $driverClass, bool $isAsync, string $jobClass, array $payloadFields, float $time, string $jobId, int|null $ttr, int|null $delay, int|null $priority, int|null $attempt, float|null $duration, string $error)Creates a queue lifecycle event record.
Parameters
| Parameter | Type | Description |
|---|---|---|
$eventType | string | |
$componentId | string | |
$driverName | string | |
$driverClass | string | |
$isAsync | bool | |
$jobClass | string | |
$payloadFields | array | |
$time | float | |
$jobId | string | |
$ttr | int| | |
$delay | int| | |
$priority | int| | |
$attempt | int| | |
$duration | float| | |
$error | string |
fromArray()
Section titled “fromArray() ”public static function fromArray(mixed $data, string $path): selfNarrows one persisted event of the queue payload into a typed record.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | Persisted event, expected to be an object carrying the declared shape. |
$path | string | JSON path of the event, used to report a malformed payload. |
Returns
self: Record carrying every persisted event field.
Throws
PHPForge\Debug\Storage\HydrationException: When the persisted event type is not one ofJobRecord::EVENT_TYPES.
fromCapture()
Section titled “fromCapture() ”public static function fromCapture(array<array-key, mixed> $row): selfNarrows one captured queue-event payload into a typed record.
Parameters
| Parameter | Type | Description |
|---|---|---|
$row | array<array-key, | Captured payload. |
Returns
self
jsonSerialize()
Section titled “jsonSerialize() ”public function jsonSerialize(): array<string, mixed>Returns the typed row for JSON serialization.
Returns
array<string, mixed>