Feature: Creating Privacy Basics
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Core\Export;
|
||||
|
||||
/**
|
||||
* One column in a CsvWriter schema: a header label plus a closure that pulls this
|
||||
* column's value out of one record. The closure doesn't care what shape a record
|
||||
* is — an array, an Eloquent model, a DTO — so the same CsvWriter serves any
|
||||
* domain (GDPR export, an admin catalog export, an accounting export) by simply
|
||||
* being handed a different column schema and a different row source.
|
||||
*/
|
||||
final class CsvColumn
|
||||
{
|
||||
/**
|
||||
* @param \Closure(mixed): (string|int|float|null) $value
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly string $header,
|
||||
public readonly \Closure $value,
|
||||
) {}
|
||||
}
|
||||
Reference in New Issue
Block a user