IndividualRecordWriterStrategy
extends AbstractRecordWriterStrategy
in package
Strategy for writing records to disk individually.
Tags
Table of Contents
- $basePath : string
- Directory for storing harvested files
- __construct() : mixed
- Constructor
- addDeletedRecord() : void
- Add the ID of a deleted record.
- addRecord() : void
- Add a non-deleted record.
- beginWrite() : void
- Called before the writing process begins.
- endWrite() : void
- Close out the writing process.
- 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 —addDeletedRecord()
Add the ID of a deleted record.
public
addDeletedRecord(string $id) : void
Parameters
- $id : string
-
ID
Return values
void —addRecord()
Add a non-deleted record.
public
addRecord(string $id, string $record) : void
Parameters
- $id : string
-
ID
- $record : string
-
Record XML
Return values
void —beginWrite()
Called before the writing process begins.
public
beginWrite() : void
Return values
void —endWrite()
Close out the writing process.
public
endWrite() : void
Return values
void —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.