AbstractRecordWriterStrategy
in package
implements
RecordWriterStrategyInterface
Abstract record writer strategy (shared base for standard vs. combined modes of saving records).
Tags
Interfaces, Classes, Traits and Enums
- RecordWriterStrategyInterface
- Interface for record writer strategies.
Table of Contents
- $basePath : string
- Directory for storing harvested files
- __construct() : mixed
- Constructor
- getBasePath() : string
- Get base path for writes.
- getFilename() : string
- Get the filename for a specific record ID.
- saveDeletedRecords() : void
- Create a tracking file to record the deletion of a record.
- saveFile() : void
- Save a record to disk.
Properties
$basePath
Directory for storing harvested files
protected
string
$basePath
Methods
__construct()
Constructor
public
__construct(string $basePath) : mixed
Parameters
- $basePath : string
-
Target directory for harvested files
Return values
mixed —getBasePath()
Get base path for writes.
public
getBasePath() : string
Return values
string —getFilename()
Get the filename for a specific record ID.
protected
getFilename(string $id, string $ext) : string
Parameters
- $id : string
-
ID of record to save.
- $ext : string
-
File extension to use.
Return values
string —Full path + filename.
saveDeletedRecords()
Create a tracking file to record the deletion of a record.
protected
saveDeletedRecords(string|array<string|int, mixed> $ids) : void
Parameters
- $ids : string|array<string|int, mixed>
-
ID(s) of deleted record(s).
Return values
void —saveFile()
Save a record to disk.
protected
saveFile(string $id, string $xml) : void
Parameters
- $id : string
-
Record ID to use for filename generation.
- $xml : string
-
XML to save.