BatchProcessDto

Overview #

BatchProcessDto is a specialized data transfer object for batch processing. It extends ProcessDto and adds methods for handling individual items in a batch.

Package: hanaboso/commons-bundle
Namespace: Hanaboso\CommonsBundle\Process

Key Methods #

getItem() #

public function getItem(): mixed

Gets the current item being processed in the batch.

Returns: mixed - The batch item

setItem() #

public function setItem(mixed $item): self

Sets the processed item data.

Parameters:

ParameterTypeDescription
$itemmixedProcessed item data

Returns: self - For method chaining

Usage Example #

public function processAction(BatchProcessDto $dto): BatchProcessDto
{
    // Get item from batch
    $user = $dto->getItem();
    
    // Process
    $processed = [
        'id' => $user['id'],
        'email' => strtolower($user['email']),
        'active' => true,
    ];
    
    // Set result
    $dto->setItem($processed);
    
    return $dto;
}

See Also #

© 2025 Orchesty Solutions. All rights reserved.